]> Pileus Git - ~andy/fetchmail/blob - interface.c
723d5e3acdb434ab142724bc522c7f2159c97b6a
[~andy/fetchmail] / interface.c
1 /*
2  * interface.c -- implements fetchmail 'interface' and 'monitor' commands
3  *
4  * This module was implemented by George M. Sipe <gsipe@pobox.com>
5  * or <gsipe@acm.org> and is:
6  *
7  *      Copyright (c) 1996,1997 by George M. Sipe
8  *
9  *      FreeBSD specific portions written by and Copyright (c) 1999 
10  *      Andy Doran <ad@psn.ie>.
11  *
12  * For license terms, see the file COPYING in this directory.
13  */
14 #include <sys/types.h>
15 #include <sys/param.h>
16
17 #if (defined(linux) && !defined(INET6_ENABLE)) || defined(__FreeBSD__)
18
19 #include "config.h"
20 #include <stdio.h>
21 #include <string.h>
22 #if defined(STDC_HEADERS)
23 #include <stdlib.h>
24 #endif
25 #if defined(HAVE_UNISTD_H)
26 #include <unistd.h>
27 #endif
28 #include <sys/ioctl.h>
29 #include <sys/socket.h>
30 #include <netinet/in.h>
31 #include <arpa/inet.h>
32 #include <net/if.h>
33 #if defined(__FreeBSD__)
34 #if defined __FreeBSD_USE_KVM
35     #if __FreeBSD_version >= 300001
36         #include <net/if_var.h>
37     #endif
38     #include <kvm.h>
39     #include <nlist.h>
40     #include <sys/fcntl.h>
41 #else
42     #include <sys/sysctl.h>
43     #include <net/route.h>
44     #include <net/if_dl.h>
45 #endif
46 #endif
47 #include "config.h"
48 #include "fetchmail.h"
49 #include "socket.h"
50 #include "i18n.h"
51 #include "tunable.h"
52
53 typedef struct {
54         struct in_addr addr, dstaddr, netmask;
55         int rx_packets, tx_packets;
56 } ifinfo_t;
57
58 struct interface_pair_s {
59         struct in_addr interface_address;
60         struct in_addr interface_mask;
61 } *interface_pair;
62
63 static char *netdevfmt;
64
65 /*
66  * Count of packets to see on an interface before monitor considers it up.
67  * Needed because when pppd shuts down the link, the packet counts go up
68  * by two (one rx and one tx?, maybe).  A value of 2 seems to do the trick,
69  * but we'll give it some extra.
70  */
71 #define MONITOR_SLOP            5
72
73 #if defined(linux)
74
75 void interface_init(void)
76 /* figure out which /proc/dev/net format to use */
77 {
78     FILE *fp = popen("uname -r", "r");  /* still wins if /proc is out */
79
80     /* pre-linux-2.2 format -- transmit packet count in 8th field */
81     netdevfmt = "%d %d %*d %*d %*d %d %*d %d %*d %*d %*d %*d %d";
82
83     if (!fp)
84         return;
85     else
86     {
87         int major, minor;
88
89         if (fscanf(fp, "%d.%d.%*d", &major, &minor) >= 2
90                                         && major >= 2 && minor >= 2)
91             /* Linux 2.2 -- transmit packet count in 10th field */
92             netdevfmt = "%d %d %*d %*d %*d %d %*d %*d %*d %d %*d %*d %d";
93         pclose(fp);
94     }
95 }
96
97 static int _get_ifinfoGT_(int socket_fd, FILE *stats_file, const char *ifname,
98                 ifinfo_t *ifinfo)
99 /* get active network interface information - return non-zero upon success */
100 {
101         int namelen = strlen(ifname);
102         struct ifreq request;
103         char *cp, buffer[256];
104         int found = 0;
105         int counts[4];
106
107         /* initialize result */
108         memset((char *) ifinfo, 0, sizeof(ifinfo_t));
109
110         /* get the packet I/O counts */
111         while (fgets(buffer, sizeof(buffer) - 1, stats_file)) {
112                 for (cp = buffer; *cp && *cp == ' '; ++cp);
113                 if (!strncmp(cp, ifname, namelen) &&
114                                 cp[namelen] == ':') {
115                         cp += namelen + 1;
116                         if (sscanf(cp, netdevfmt,
117                                    counts, counts+1, counts+2, 
118                                    counts+3,&found)>4) { /* found = dummy */
119                                 /* newer kernel with byte counts */
120                                 ifinfo->rx_packets=counts[1];
121                                 ifinfo->tx_packets=counts[3];
122                         } else {
123                                 /* older kernel, no byte counts */
124                                 ifinfo->rx_packets=counts[0];
125                                 ifinfo->tx_packets=counts[2];
126                         }
127                         found = 1;
128                 }
129         }
130         if (!found) return (FALSE);
131
132         /* see if the interface is up */
133         strcpy(request.ifr_name, ifname);
134         if (ioctl(socket_fd, SIOCGIFFLAGS, &request) < 0)
135                 return(FALSE);
136         if (!(request.ifr_flags & IFF_RUNNING))
137                 return(FALSE);
138
139         /* get the (local) IP address */
140         strcpy(request.ifr_name, ifname);
141         if (ioctl(socket_fd, SIOCGIFADDR, &request) < 0)
142                 return(FALSE);
143         ifinfo->addr = ((struct sockaddr_in *) (&request.ifr_addr))->sin_addr;
144
145         /* get the PPP destination (remote) IP address */
146         ifinfo->dstaddr.s_addr = 0;
147         strcpy(request.ifr_name, ifname);
148         if (ioctl(socket_fd, SIOCGIFDSTADDR, &request) >= 0)
149                 ifinfo->dstaddr = ((struct sockaddr_in *)
150                                         (&request.ifr_dstaddr))->sin_addr;
151
152         /* get the netmask */
153         strcpy(request.ifr_name, ifname);
154         if (ioctl(socket_fd, SIOCGIFNETMASK, &request) >= 0) {
155           ifinfo->netmask = ((struct sockaddr_in *)
156                              (&request.ifr_netmask))->sin_addr;
157           return (TRUE);
158         }
159
160         return(FALSE);
161 }
162
163 static int get_ifinfo(const char *ifname, ifinfo_t *ifinfo)
164 {
165         int socket_fd = socket(AF_INET, SOCK_DGRAM, 0);
166         FILE *stats_file = fopen("/proc/net/dev", "r");
167         int result;
168
169         if (socket_fd < 0 || !stats_file)
170                 result = FALSE;
171         else
172         {
173             char        *sp = strchr(ifname, '/');
174
175             if (sp)
176                 *sp = '\0';
177             result = _get_ifinfoGT_(socket_fd, stats_file, ifname, ifinfo);
178             if (sp)
179                 *sp = '/';
180         }
181         if (socket_fd >= 0)
182             SockClose(socket_fd);
183         if (stats_file)
184             fclose(stats_file); /* not checking should be safe, mode was "r" */
185         return(result);
186 }
187
188 #elif defined __FreeBSD__
189
190 #if defined __FreeBSD_USE_KVM
191
192 static kvm_t *kvmfd;
193 static struct nlist symbols[] = 
194 {
195         {"_ifnet"},
196         {NULL}
197 };
198 static u_long   ifnet_savedaddr;
199 static gid_t    if_rgid;
200 static gid_t    if_egid;
201
202 void 
203 interface_set_gids(gid_t egid, gid_t rgid)
204 {
205         if_rgid = rgid;
206         if_egid = egid;
207 }
208
209 static int 
210 openkvm(void)
211 {
212         if ((kvmfd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL)) == NULL)
213                 return FALSE;
214         
215         if (kvm_nlist(kvmfd, symbols) < 0)
216                 return FALSE;
217            
218         if (kvm_read(kvmfd, (unsigned long) symbols[0].n_value, &ifnet_savedaddr, sizeof(unsigned long)) == -1)
219                 return FALSE;
220                 
221         return TRUE;
222 }
223
224 static int 
225 get_ifinfo(const char *ifname, ifinfo_t *ifinfo)
226 {
227         char                    tname[16];
228         char                    iname[16];
229         struct ifnet            ifnet;
230         unsigned long           ifnet_addr = ifnet_savedaddr;
231 #if __FreeBSD_version >= 300001
232         struct ifnethead        ifnethead;
233         struct ifaddrhead       ifaddrhead;
234 #endif
235         struct ifaddr           ifaddr;
236         unsigned long           ifaddr_addr;
237         struct sockaddr         sa;
238         unsigned long           sa_addr;
239         uint                    i;
240         
241         if (if_egid)
242                 setegid(if_egid);
243         
244         for (i = 0; ifname[i] && ifname[i] != '/'; i++)
245                 iname[i] = ifname[i];
246                 
247         iname[i] = '\0';
248         
249         if (!kvmfd)
250         {
251                 if (!openkvm())
252                 {
253                         report(stderr, 0, GT_("Unable to open kvm interface. Make sure fetchmail is SGID kmem."));
254                         if (if_egid)
255                                 setegid(if_rgid);
256                         exit(1);
257                 }
258         }
259
260 #if __FreeBSD_version >= 300001
261         kvm_read(kvmfd, ifnet_savedaddr, (char *) &ifnethead, sizeof ifnethead);
262         ifnet_addr = (u_long) ifnethead.tqh_first;
263 #else
264         ifnet_addr = ifnet_savedaddr;
265 #endif
266
267         while (ifnet_addr)
268         {
269                 kvm_read(kvmfd, ifnet_addr, &ifnet, sizeof(ifnet));
270                 kvm_read(kvmfd, (unsigned long) ifnet.if_name, tname, sizeof tname);
271 #ifdef HAVE_SNPRINTF
272                 snprintf(tname, sizeof tname - 1,
273 #else
274                 sprintf(tname,
275 #endif
276                         "%s%d", tname, ifnet.if_unit);
277
278                 if (!strcmp(tname, iname))
279                 {
280                         if (!(ifnet.if_flags & IFF_UP))
281                         {
282                                 if (if_egid)
283                                         setegid(if_rgid);
284                                 return 0;
285                         }
286                                 
287                         ifinfo->rx_packets = ifnet.if_ipackets;
288                         ifinfo->tx_packets = ifnet.if_opackets;
289
290 #if __FreeBSD_version >= 300001
291                         ifaddr_addr = (u_long) ifnet.if_addrhead.tqh_first;
292 #else
293                         ifaddr_addr = (u_long) ifnet.if_addrlist;
294 #endif
295                         
296                         while(ifaddr_addr)
297                         {
298                                 kvm_read(kvmfd, ifaddr_addr, &ifaddr, sizeof(ifaddr));
299                                 kvm_read(kvmfd, (u_long)ifaddr.ifa_addr, &sa, sizeof(sa));
300                                 
301                                 if (sa.sa_family != AF_INET)
302                                 {
303 #if __FreeBSD_version >= 300001
304                                         ifaddr_addr = (u_long) ifaddr.ifa_link.tqe_next;
305 #else
306                                         ifaddr_addr = (u_long) ifaddr.ifa_next;
307 #endif
308                                         continue;
309                                 }
310                         
311                                 ifinfo->addr.s_addr = *(u_long *)(sa.sa_data + 2);
312                                 kvm_read(kvmfd, (u_long)ifaddr.ifa_dstaddr, &sa, sizeof(sa));
313                                 ifinfo->dstaddr.s_addr = *(u_long *)(sa.sa_data + 2);
314                                 kvm_read(kvmfd, (u_long)ifaddr.ifa_netmask, &sa, sizeof(sa));
315                                 ifinfo->netmask.s_addr = *(u_long *)(sa.sa_data + 2);
316
317                                 if (if_egid)
318                                         setegid(if_rgid);
319
320                                 return 1;
321                         }
322                         
323                         if (if_egid)
324                                 setegid(if_rgid);
325                         
326                         return 0;
327                 }
328
329 #if __FreeBSD_version >= 300001
330                 ifnet_addr = (u_long) ifnet.if_link.tqe_next;
331 #else
332                 ifnet_addr = (unsigned long) ifnet.if_next;
333 #endif
334         }
335
336         if (if_egid)
337                 setegid(if_rgid);
338         
339         return 0;
340 }
341
342 #else /* Do not use KVM on FreeBSD */
343
344 /*
345  * Expand the compacted form of addresses as returned via the
346  * configuration read via sysctl().
347  */
348
349 static void
350 rt_xaddrs(caddr_t cp, caddr_t cplim, struct rt_addrinfo *rtinfo)
351 {
352     struct sockaddr *sa;
353     int i;
354
355 #define ROUNDUP(a) \
356         ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
357 #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
358
359     memset(rtinfo->rti_info, 0, sizeof(rtinfo->rti_info));
360     for (i = 0; (i < RTAX_MAX) && (cp < cplim); i++) {
361         if ((rtinfo->rti_addrs & (1 << i)) == 0)
362             continue;
363         rtinfo->rti_info[i] = sa = (struct sockaddr *)cp;
364         ADVANCE(cp, sa);
365     }
366
367 #undef ROUNDUP
368 #undef ADVANCE
369 }
370
371 static int
372 get_ifinfo(const char *ifname, ifinfo_t *ifinfo)
373 {
374     uint                i;
375     int                 rc = 0;
376     int                 ifindex = -1;
377     size_t              needed;
378     char                *buf = NULL;
379     char                *lim = NULL;
380     char                *next = NULL;
381     struct if_msghdr    *ifm;
382     struct ifa_msghdr   *ifam;
383     struct sockaddr_in  *sin;
384     struct sockaddr_dl  *sdl;
385     struct rt_addrinfo  info;
386     char                iname[16];
387     int                 mib[6];
388
389     memset(ifinfo, 0, sizeof(ifinfo));
390
391     /* trim interface name */
392
393     for (i = 0; i < sizeof(iname) && ifname[i] && ifname[i] != '/'; i++)
394         iname[i] = ifname[i];
395         
396     if (i == 0 || i == sizeof(iname))
397     {
398         report(stderr, GT_("Unable to parse interface name from %s"), ifname);
399         return 0;
400     }
401
402     iname[i] = 0;
403
404
405     /* get list of existing interfaces */
406
407     mib[0] = CTL_NET;
408     mib[1] = PF_ROUTE;
409     mib[2] = 0;
410     mib[3] = AF_INET;           /* Only IP addresses please. */
411     mib[4] = NET_RT_IFLIST;
412     mib[5] = 0;                 /* List all interfaces. */
413
414
415     /* Get interface data. */
416
417     if (sysctl(mib, 6, NULL, &needed, NULL, 0) == -1)
418     {
419         report(stderr, 
420             GT_("get_ifinfo: sysctl (iflist estimate) failed"));
421         exit(1);
422     }
423     if ((buf = malloc(needed)) == NULL)
424     {
425         report(stderr, 
426             GT_("get_ifinfo: malloc failed"));
427         exit(1);
428     }
429     if (sysctl(mib, 6, buf, &needed, NULL, 0) == -1)
430     {
431         report(stderr, 
432             GT_("get_ifinfo: sysctl (iflist) failed"));
433         exit(1);
434     }
435
436     lim = buf+needed;
437
438
439     /* first look for the interface information */
440
441     next = buf;
442     while (next < lim)
443     {
444         ifm = (struct if_msghdr *)next;
445         next += ifm->ifm_msglen;
446
447         if (ifm->ifm_version != RTM_VERSION) 
448         {
449             report(stderr, 
450                 GT_("Routing message version %d not understood."),
451                 ifm->ifm_version);
452             exit(1);
453         }
454
455         if (ifm->ifm_type == RTM_IFINFO)
456         {
457             sdl = (struct sockaddr_dl *)(ifm + 1);
458
459             if (!(strlen(iname) == sdl->sdl_nlen 
460                 && strncmp(iname, sdl->sdl_data, sdl->sdl_nlen) == 0))
461             {
462                 continue;
463             }
464
465             if ( !(ifm->ifm_flags & IFF_UP) )
466             {
467                 /* the interface is down */
468                 goto get_ifinfo_end;
469             }
470
471             ifindex = ifm->ifm_index;
472             ifinfo->rx_packets = ifm->ifm_data.ifi_ipackets;
473             ifinfo->tx_packets = ifm->ifm_data.ifi_opackets;
474
475             break;
476         }
477     }
478
479     if (ifindex < 0)
480     {
481         /* we did not find an interface with a matching name */
482         report(stderr, GT_("No interface found with name %s"), iname);
483         goto get_ifinfo_end;
484     }
485
486     /* now look for the interface's IP address */
487
488     next = buf;
489     while (next < lim)
490     {
491         ifam = (struct ifa_msghdr *)next;
492         next += ifam->ifam_msglen;
493
494         if (ifindex > 0
495             && ifam->ifam_type == RTM_NEWADDR
496             && ifam->ifam_index == ifindex)
497         {
498             /* Expand the compacted addresses */
499             info.rti_addrs = ifam->ifam_addrs;
500             rt_xaddrs((char *)(ifam + 1), 
501                         ifam->ifam_msglen + (char *)ifam,
502                         &info);
503
504             /* Check for IPv4 address information only */
505             if (info.rti_info[RTAX_IFA]->sa_family != AF_INET)
506             {
507                 continue;
508             }
509
510             rc = 1;
511
512             sin = (struct sockaddr_in *)info.rti_info[RTAX_IFA];
513             if (sin)
514             {
515                 ifinfo->addr = sin->sin_addr;
516             }
517
518             sin = (struct sockaddr_in *)info.rti_info[RTAX_NETMASK];
519             if (!sin)
520             {
521                 ifinfo->netmask = sin->sin_addr;
522             }
523
524             /* note: RTAX_BRD contains the address at the other
525              * end of a point-to-point link or the broadcast address
526              * of non point-to-point link
527              */
528             sin = (struct sockaddr_in *)info.rti_info[RTAX_BRD];
529             if (!sin)
530             {
531                 ifinfo->dstaddr = sin->sin_addr;
532             }
533
534             break;
535         }
536     }
537
538     if (rc == 0)
539     {
540         report(stderr, GT_("No IP address found for %s"), iname);
541     }
542
543 get_ifinfo_end:
544     free(buf);
545     return rc;
546 }
547
548 #endif /* __FREEBSD_USE_SYSCTL_GET_IFFINFO */
549
550 #endif /* defined __FreeBSD__ */
551
552
553 #ifndef HAVE_INET_ATON
554 /*
555  * Note: This is not a true replacement for inet_aton(), as it won't
556  * do the right thing on "255.255.255.255" (which translates to -1 on
557  * most machines).  Fortunately this code will be used only if you're
558  * on an older Linux that lacks a real implementation.
559  */
560 #ifdef HAVE_NETINET_IN_SYSTM_H
561 # include <sys/types.h>
562 # include <netinet/in_systm.h>
563 #endif
564
565 #include <netinet/in.h>
566 #include <netinet/ip.h>
567 #include <arpa/inet.h>
568 #include <string.h>
569
570 static int inet_aton(const char *cp, struct in_addr *inp) {
571     long addr;
572
573     addr = inet_addr(cp);
574     if (addr == ((long) -1)) return 0;
575
576     memcpy(inp, &addr, sizeof(addr));
577     return 1;
578 }
579 #endif /* HAVE_INET_ATON */
580
581 void interface_parse(char *buf, struct hostdata *hp)
582 /* parse 'interface' specification */
583 {
584         char *cp1, *cp2;
585
586         hp->interface = xstrdup(buf);
587
588         /* find and isolate just the IP address */
589         if (!(cp1 = strchr(buf, '/')))
590         {
591                 (void) report(stderr,
592                               GT_("missing IP interface address\n"));
593                 exit(PS_SYNTAX);
594         }
595         *cp1++ = '\000';
596
597         /* find and isolate just the netmask */
598         if (!(cp2 = strchr(cp1, '/')))
599                 cp2 = "255.255.255.255";
600         else
601                 *cp2++ = '\000';
602
603         /* convert IP address and netmask */
604         hp->interface_pair = (struct interface_pair_s *)xmalloc(sizeof(struct interface_pair_s));
605         if (!inet_aton(cp1, &hp->interface_pair->interface_address))
606         {
607                 (void) report(stderr,
608                               GT_("invalid IP interface address\n"));
609                 exit(PS_SYNTAX);
610         }
611         if (!inet_aton(cp2, &hp->interface_pair->interface_mask))
612         {
613                 (void) report(stderr,
614                               GT_("invalid IP interface mask\n"));
615                 exit(PS_SYNTAX);
616         }
617         /* apply the mask now to the IP address (range) required */
618         hp->interface_pair->interface_address.s_addr &=
619                 hp->interface_pair->interface_mask.s_addr;
620
621         /* restore original interface string (for configuration dumper) */
622         *--cp1 = '/';
623         return;
624 }
625
626 void interface_note_activity(struct hostdata *hp)
627 /* save interface I/O counts */
628 {
629         ifinfo_t ifinfo;
630         struct query *ctl;
631
632         /* if not monitoring link, all done */
633         if (!hp->monitor)
634                 return;
635
636         /* get the current I/O stats for the monitored link */
637         if (get_ifinfo(hp->monitor, &ifinfo))
638                 /* update this and preceeding host entries using the link
639                    (they were already set during this pass but the I/O
640                    count has now changed and they need to be re-updated)
641                 */
642                 for (ctl = querylist; ctl; ctl = ctl->next) {
643                         if (ctl->server.monitor && !strcmp(hp->monitor, ctl->server.monitor))
644                                 ctl->server.monitor_io =
645                                         ifinfo.rx_packets + ifinfo.tx_packets;
646                         /* do NOT update host entries following this one */
647                         if (&ctl->server == hp)
648                                 break;
649                 }
650
651 #ifdef  ACTIVITY_DEBUG
652         (void) report(stdout, 
653                       GT_("activity on %s -noted- as %d\n"), 
654                       hp->monitor, hp->monitor_io);
655 #endif
656 }
657
658 int interface_approve(struct hostdata *hp, flag domonitor)
659 /* return TRUE if OK to poll, FALSE otherwise */
660 {
661         ifinfo_t ifinfo;
662
663         /* check interface IP address (range), if specified */
664         if (hp->interface) {
665                 /* get interface info */
666                 if (!get_ifinfo(hp->interface, &ifinfo)) {
667                         (void) report(stdout, 
668                                       GT_("skipping poll of %s, %s down\n"),
669                                       hp->pollname, hp->interface);
670                         return(FALSE);
671                 }
672                 /* check the IP addresses (range) */
673                 if      (!(
674                                 /* check remote IP address */
675                                 ((ifinfo.dstaddr.s_addr != 0) &&
676                                 (ifinfo.dstaddr.s_addr &
677                                 hp->interface_pair->interface_mask.s_addr) ==
678                                 hp->interface_pair->interface_address.s_addr)
679                                 ||
680                                 /* check local IP address */
681                                 ((ifinfo.addr.s_addr &
682                                 hp->interface_pair->interface_mask.s_addr) ==
683                                 hp->interface_pair->interface_address.s_addr)
684                         ) )
685                 {
686                         (void) report(stdout,
687                                 GT_("skipping poll of %s, %s IP address excluded\n"),
688                                 hp->pollname, hp->interface);
689                         return(FALSE);
690                 }
691         }
692
693         /* if not monitoring link, all done */
694         if (!domonitor || !hp->monitor)
695                 return(TRUE);
696
697 #ifdef  ACTIVITY_DEBUG
698         (void) report(stdout, 
699                       GT_("activity on %s checked as %d\n"), 
700                       hp->monitor, hp->monitor_io);
701 #endif
702         /* if monitoring, check link for activity if it is up */
703         if (get_ifinfo(hp->monitor, &ifinfo))
704         {
705             int diff = (ifinfo.rx_packets + ifinfo.tx_packets)
706                                                         - hp->monitor_io;
707
708             /*
709              * There are three cases here:
710              *
711              * (a) If the new packet count is less than the recorded one,
712              * probably pppd was restarted while fetchmail was running.
713              * Don't skip.
714              *
715              * (b) newpacket count is greater than the old packet count,
716              * but the difference is small and may just reflect the overhead
717              * of a link shutdown.  Skip.
718              *
719              * (c) newpacket count is greater than the old packet count,
720              * and the difference is large. Connection is live.  Don't skip.
721              */
722             if (diff >= 0 && diff <= MONITOR_SLOP)
723             {
724                 (void) report(stdout, 
725                               GT_("skipping poll of %s, %s inactive\n"),
726                               hp->pollname, hp->monitor);
727                 return(FALSE);
728             }
729         }
730
731 #ifdef ACTIVITY_DEBUG
732        report(stdout, GT_("activity on %s was %d, is %d\n"),
733              hp->monitor, hp->monitor_io,
734              ifinfo.rx_packets + ifinfo.tx_packets);
735 #endif
736
737         return(TRUE);
738 }
739 #endif /* (defined(linux) && !defined(INET6_ENABLE)) || defined(__FreeBSD__) */