svn commit: r308347 - head/usr.sbin/traceroute6
Author: hrs Date: Sat Nov 5 18:00:36 2016 New Revision: 308347 URL: https://svnweb.freebsd.org/changeset/base/308347 Log: Fix an infinite loop at an non-responding hop when other echo replies are kept arriving in the waittime time window. Submitted by: Denny Page PR: 210286 MFC after:3 days Modified: head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/traceroute6.c == --- head/usr.sbin/traceroute6/traceroute6.c Sat Nov 5 17:02:38 2016 (r308346) +++ head/usr.sbin/traceroute6/traceroute6.c Sat Nov 5 18:00:36 2016 (r308347) @@ -955,6 +955,9 @@ main(argc, argv) break; } break; + } else if (deltaT(&t1, &t2) > waittime * 1000) { + cc = 0; + break; } } if (cc == 0) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308348 - head/usr.sbin/rtadvd
Author: hrs Date: Sat Nov 5 19:51:13 2016 New Revision: 308348 URL: https://svnweb.freebsd.org/changeset/base/308348 Log: Add link-layer address option in RA even for IFT_L2VLAN and IFT_BRIDGE. Reported by: philip MFC after:3 days Modified: head/usr.sbin/rtadvd/if.c Modified: head/usr.sbin/rtadvd/if.c == --- head/usr.sbin/rtadvd/if.c Sat Nov 5 18:00:36 2016(r308347) +++ head/usr.sbin/rtadvd/if.c Sat Nov 5 19:51:13 2016(r308348) @@ -114,6 +114,8 @@ lladdropt_length(struct sockaddr_dl *sdl { switch (sdl->sdl_type) { case IFT_ETHER: + case IFT_L2VLAN: + case IFT_BRIDGE: return (ROUNDUP8(ETHER_ADDR_LEN + 2)); default: return (0); @@ -129,6 +131,8 @@ lladdropt_fill(struct sockaddr_dl *sdl, switch (sdl->sdl_type) { case IFT_ETHER: + case IFT_L2VLAN: + case IFT_BRIDGE: ndopt->nd_opt_len = (ROUNDUP8(ETHER_ADDR_LEN + 2)) >> 3; addr = (char *)(ndopt + 1); memcpy(addr, LLADDR(sdl), ETHER_ADDR_LEN); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r309925 - head/usr.sbin/syslogd
Author: hrs Date: Mon Dec 12 19:10:14 2016 New Revision: 309925 URL: https://svnweb.freebsd.org/changeset/base/309925 Log: - Refactor listening socket list. All of the listening sockets are now maintained in a single linked-list in a transport-independent manner. - Use queue.h for linked-list structure. - Use linked-list for AllowedPeers. - Use getaddrinfo(8) even for Unix Domain sockets. - Use macros to type-casting from/to struct sockaddr{,_in,_in6}. - Define fu_* macro for union f_un to shorten the member names. - Remove an extra #include . - Add "static" to non-exported symbols. - !INET support is still incomplete but will be fixed later. There is no functional change except for some minor debug messages. Modified: head/usr.sbin/syslogd/Makefile head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/Makefile == --- head/usr.sbin/syslogd/Makefile Mon Dec 12 19:09:17 2016 (r309924) +++ head/usr.sbin/syslogd/Makefile Mon Dec 12 19:10:14 2016 (r309925) @@ -13,6 +13,9 @@ LIBADD= util WARNS?= 3 +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DINET +.endif .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif Modified: head/usr.sbin/syslogd/syslogd.c == --- head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:09:17 2016 (r309924) +++ head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:10:14 2016 (r309925) @@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -116,43 +115,60 @@ __FBSDID("$FreeBSD$"); #define SYSLOG_NAMES #include -const char *ConfFile = _PATH_LOGCONF; -const char *PidFile = _PATH_LOGPID; -const char ctty[] = _PATH_CONSOLE; -static const char include_str[] = "include"; -static const char include_ext[] = ".conf"; +static const char *ConfFile = _PATH_LOGCONF; +static const char *PidFile = _PATH_LOGPID; +static const char ctty[] = _PATH_CONSOLE; +static const char include_str[] = "include"; +static const char include_ext[] = ".conf"; #definedprintf if (Debug) printf #defineMAXUNAMES 20 /* maximum number of user names */ +#definesstosa(ss) ((struct sockaddr *)(ss)) +#ifdef INET +#definesatosin(sa) ((struct sockaddr_in *)(void *)(sa)) +#endif +#ifdef INET6 +#definesatosin6(sa)((struct sockaddr_in6 *)(void *)(sa)) +#defines6_addr32 __u6_addr.__u6_addr32 +#defineIN6_ARE_MASKED_ADDR_EQUAL(d, a, m) ( \ + (((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \ + (((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \ + (((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \ + (((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 ) +#endif /* - * List of hosts for binding. + * List of peers and sockets for binding. */ -static STAILQ_HEAD(, host) hqueue; -struct host { - char*name; - STAILQ_ENTRY(host) next; +struct peer { + const char *pe_name; + const char *pe_serv; + mode_t pe_mode; + STAILQ_ENTRY(peer) next; }; - -/* - * Unix sockets. - * We have two default sockets, one with 666 permissions, - * and one for privileged programs. - */ -struct funix { - int s; - const char *name; - mode_t mode; - STAILQ_ENTRY(funix) next; +struct socklist { + struct sockaddr_storage sl_ss; + int sl_socket; + struct peer *sl_peer; + STAILQ_ENTRY(socklist) next; }; -struct funix funix_secure ={ -1, _PATH_LOG_PRIV, S_IRUSR | S_IWUSR, - { NULL } }; -struct funix funix_default = { -1, _PATH_LOG, DEFFILEMODE, - { &funix_secure } }; +static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INITIALIZER(shead); -STAILQ_HEAD(, funix) funixes = { &funix_default, - &(funix_secure.next.stqe_next) }; +static struct peer funix_secure = { + .pe_name = _PATH_LOG_PRIV, + .pe_mode = S_IRUSR | S_IWUSR, + .next = {NULL}, +}; +static struct peer funix_default = { + .pe_name = _PATH_LOG, + .pe_mode = DEFFILEMODE, + .next = {&funix_secure}, +}; +static STAILQ_HEAD(, peer) pqueue = { + &funix_default, + &funix_secure.next.stqe_next, +}; /* * Flags to logmsg(). @@ -172,7 +188,7 @@ STAILQ_HEAD(, funix) funixes = { &funix_ */ struct filed { - struct filed *f_next; /* next in linked list */ + STAILQ_ENTRY(filed) next; /* next in linked list */ short f_type; /* entry type, see below */ short f_fil
svn commit: r309931 - head/usr.sbin/syslogd
Author: hrs Date: Mon Dec 12 19:24:52 2016 New Revision: 309931 URL: https://svnweb.freebsd.org/changeset/base/309931 Log: Temporarily backout the previous commit because it was totally broken due to unresolved merge conflicts. Pointy hat to:hrs Modified: head/usr.sbin/syslogd/Makefile head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/Makefile == --- head/usr.sbin/syslogd/Makefile Mon Dec 12 19:24:32 2016 (r309930) +++ head/usr.sbin/syslogd/Makefile Mon Dec 12 19:24:52 2016 (r309931) @@ -13,9 +13,6 @@ LIBADD= util WARNS?= 3 -.if ${MK_INET_SUPPORT} != "no" -CFLAGS+= -DINET -.endif .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif Modified: head/usr.sbin/syslogd/syslogd.c == --- head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:24:32 2016 (r309930) +++ head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:24:52 2016 (r309931) @@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -115,60 +116,43 @@ __FBSDID("$FreeBSD$"); #define SYSLOG_NAMES #include -static const char *ConfFile = _PATH_LOGCONF; -static const char *PidFile = _PATH_LOGPID; -static const char ctty[] = _PATH_CONSOLE; -static const char include_str[] = "include"; -static const char include_ext[] = ".conf"; +const char *ConfFile = _PATH_LOGCONF; +const char *PidFile = _PATH_LOGPID; +const char ctty[] = _PATH_CONSOLE; +static const char include_str[] = "include"; +static const char include_ext[] = ".conf"; #definedprintf if (Debug) printf #defineMAXUNAMES 20 /* maximum number of user names */ -#definesstosa(ss) ((struct sockaddr *)(ss)) -#ifdef INET -#definesatosin(sa) ((struct sockaddr_in *)(void *)(sa)) -#endif -#ifdef INET6 -#definesatosin6(sa)((struct sockaddr_in6 *)(void *)(sa)) -#defines6_addr32 __u6_addr.__u6_addr32 -#defineIN6_ARE_MASKED_ADDR_EQUAL(d, a, m) ( \ - (((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \ - (((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \ - (((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \ - (((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 ) -#endif /* - * List of peers and sockets for binding. + * List of hosts for binding. */ -struct peer { - const char *pe_name; - const char *pe_serv; - mode_t pe_mode; - STAILQ_ENTRY(peer) next; -}; -struct socklist { - struct sockaddr_storage sl_ss; - int sl_socket; - struct peer *sl_peer; - STAILQ_ENTRY(socklist) next; +static STAILQ_HEAD(, host) hqueue; +struct host { + char*name; + STAILQ_ENTRY(host) next; }; -static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INITIALIZER(shead); -static struct peer funix_secure = { - .pe_name = _PATH_LOG_PRIV, - .pe_mode = S_IRUSR | S_IWUSR, - .next = {NULL}, -}; -static struct peer funix_default = { - .pe_name = _PATH_LOG, - .pe_mode = DEFFILEMODE, - .next = {&funix_secure}, -}; -static STAILQ_HEAD(, peer) pqueue = { - &funix_default, - &funix_secure.next.stqe_next, +/* + * Unix sockets. + * We have two default sockets, one with 666 permissions, + * and one for privileged programs. + */ +struct funix { + int s; + const char *name; + mode_t mode; + STAILQ_ENTRY(funix) next; }; +struct funix funix_secure ={ -1, _PATH_LOG_PRIV, S_IRUSR | S_IWUSR, + { NULL } }; +struct funix funix_default = { -1, _PATH_LOG, DEFFILEMODE, + { &funix_secure } }; + +STAILQ_HEAD(, funix) funixes = { &funix_default, + &(funix_secure.next.stqe_next) }; /* * Flags to logmsg(). @@ -188,7 +172,7 @@ static STAILQ_HEAD(, peer) pqueue = { */ struct filed { - STAILQ_ENTRY(filed) next; /* next in linked list */ + struct filed *f_next; /* next in linked list */ short f_type; /* entry type, see below */ short f_file; /* file descriptor */ time_t f_time; /* time this was last written */ @@ -212,12 +196,6 @@ struct filed { pid_t f_pid; } f_pipe; } f_un; -#definefu_unamef_un.f_uname -#definefu_forw_hname f_un.f_forw.f_hname -#definefu_forw_addrf_un.f_forw.f_addr -#definefu_fnamef_un.f_fname -#definefu_pipe_pname f_un.f_pipe.f_pname -#define
svn commit: r309933 - head/usr.sbin/syslogd
Author: hrs Date: Mon Dec 12 19:33:40 2016 New Revision: 309933 URL: https://svnweb.freebsd.org/changeset/base/309933 Log: - Refactor listening socket list. All of the listening sockets are now maintained in a single linked-list in a transport-independent manner. - Use queue.h for linked-list structure. - Use linked-list for AllowedPeers. - Use getaddrinfo(8) even for Unix Domain sockets. - Use macros to type-casting from/to struct sockaddr{,_in,_in6}. - Define fu_* macro for union f_un to shorten the member names. - Remove an extra #include . - Add "static" to non-exported symbols. - !INET support is still incomplete but will be fixed later. There is no functional change except for some minor debug messages. Modified: head/usr.sbin/syslogd/Makefile head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/Makefile == --- head/usr.sbin/syslogd/Makefile Mon Dec 12 19:26:55 2016 (r309932) +++ head/usr.sbin/syslogd/Makefile Mon Dec 12 19:33:40 2016 (r309933) @@ -13,6 +13,9 @@ LIBADD= util WARNS?= 3 +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DINET +.endif .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif Modified: head/usr.sbin/syslogd/syslogd.c == --- head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:26:55 2016 (r309932) +++ head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:33:40 2016 (r309933) @@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -116,43 +115,56 @@ __FBSDID("$FreeBSD$"); #define SYSLOG_NAMES #include -const char *ConfFile = _PATH_LOGCONF; -const char *PidFile = _PATH_LOGPID; -const char ctty[] = _PATH_CONSOLE; -static const char include_str[] = "include"; -static const char include_ext[] = ".conf"; +static const char *ConfFile = _PATH_LOGCONF; +static const char *PidFile = _PATH_LOGPID; +static const char ctty[] = _PATH_CONSOLE; +static const char include_str[] = "include"; +static const char include_ext[] = ".conf"; #definedprintf if (Debug) printf #defineMAXUNAMES 20 /* maximum number of user names */ -/* - * List of hosts for binding. - */ -static STAILQ_HEAD(, host) hqueue; -struct host { - char*name; - STAILQ_ENTRY(host) next; +#definesstosa(ss) ((struct sockaddr *)(ss)) +#definesatosin6(sa)((struct sockaddr_in6 *)(void *)(sa)) +#definesatosin(sa) ((struct sockaddr_in *)(void *)(sa)) +#defines6_addr32 __u6_addr.__u6_addr32 +#defineIN6_ARE_MASKED_ADDR_EQUAL(d, a, m) ( \ + (((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \ + (((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \ + (((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \ + (((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 ) +/* + * List of peers and sockets for binding. + */ +struct peer { + const char *pe_name; + const char *pe_serv; + mode_t pe_mode; + STAILQ_ENTRY(peer) next; }; - -/* - * Unix sockets. - * We have two default sockets, one with 666 permissions, - * and one for privileged programs. - */ -struct funix { - int s; - const char *name; - mode_t mode; - STAILQ_ENTRY(funix) next; +struct socklist { + struct sockaddr_storage sl_ss; + int sl_socket; + struct peer *sl_peer; + STAILQ_ENTRY(socklist) next; }; -struct funix funix_secure ={ -1, _PATH_LOG_PRIV, S_IRUSR | S_IWUSR, - { NULL } }; -struct funix funix_default = { -1, _PATH_LOG, DEFFILEMODE, - { &funix_secure } }; +static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INITIALIZER(shead); -STAILQ_HEAD(, funix) funixes = { &funix_default, - &(funix_secure.next.stqe_next) }; +static struct peer funix_secure = { + .pe_name = _PATH_LOG_PRIV, + .pe_mode = S_IRUSR | S_IWUSR, + .next = {NULL}, +}; +static struct peer funix_default = { + .pe_name = _PATH_LOG, + .pe_mode = DEFFILEMODE, + .next = {&funix_secure}, +}; +static STAILQ_HEAD(, peer) pqueue = { + &funix_default, + &funix_secure.next.stqe_next, +}; /* * Flags to logmsg(). @@ -172,7 +184,7 @@ STAILQ_HEAD(, funix) funixes = { &funix_ */ struct filed { - struct filed *f_next; /* next in linked list */ + STAILQ_ENTRY(filed) next; /* next in linked list */ short f_type; /* entry type, see below */ short f_file; /* file descrip
svn commit: r310035 - head/usr.sbin/syslogd
Author: hrs Date: Tue Dec 13 20:55:46 2016 New Revision: 310035 URL: https://svnweb.freebsd.org/changeset/base/310035 Log: Remove an extra "break" which could incorrectly terminate an STAILQ_FOREACH() loop when an AF_INET6 rule matched. Spotted by: cem Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c == --- head/usr.sbin/syslogd/syslogd.c Tue Dec 13 20:54:38 2016 (r310034) +++ head/usr.sbin/syslogd/syslogd.c Tue Dec 13 20:55:46 2016 (r310035) @@ -2465,7 +2465,6 @@ validate(struct sockaddr *sa, const char struct allowedpeer *ap; struct sockaddr_in *sin4, *a4p = NULL, *m4p = NULL; #ifdef INET6 - int reject; struct sockaddr_in6 *sin6, *a6p = NULL, *m6p = NULL; #endif struct addrinfo hints, *res; @@ -2533,13 +2532,8 @@ validate(struct sockaddr *sa, const char dprintf("rejected in rule %d due to scope mismatch.\n", i); continue; } - reject = 0; if (IN6_ARE_MASKED_ADDR_EQUAL(&sin6->sin6_addr, &a6p->sin6_addr, &m6p->sin6_addr) != 0) { - ++reject; - break; - } - if (reject) { dprintf("rejected in rule %d due to IP mismatch.\n", i); continue; } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r309933 - head/usr.sbin/syslogd
Conrad Meyer wrote in : ce> On Mon, Dec 12, 2016 at 11:33 AM, Hiroki Sato wrote: ce> > Author: hrs ce> > Date: Mon Dec 12 19:33:40 2016 ce> > New Revision: 309933 ce> > URL: https://svnweb.freebsd.org/changeset/base/309933 ce> > ce> > Log: ce> > - Refactor listening socket list. All of the listening sockets are ce> > now maintained in a single linked-list in a transport-independent manner. ce> > - Use queue.h for linked-list structure. ce> > - Use linked-list for AllowedPeers. ce> > - Use getaddrinfo(8) even for Unix Domain sockets. ce> > - Use macros to type-casting from/to struct sockaddr{,_in,_in6}. ce> > - Define fu_* macro for union f_un to shorten the member names. ce> > - Remove an extra #include . ce> > - Add "static" to non-exported symbols. ce> > - !INET support is still incomplete but will be fixed later. ce> > ce> > There is no functional change except for some minor debug messages. ce> ce> Hello Hiroki, ce> ce> This refactor introduced a bug in the IPv6 address comparison/rejection logic. ce> ce> > Modified: head/usr.sbin/syslogd/syslogd.c ce> > == ce> > --- head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:26:55 2016 (r309932) ce> > +++ head/usr.sbin/syslogd/syslogd.c Mon Dec 12 19:33:40 2016 (r309933) ce> > ... ce> > reject = 0; ce> > - for (j = 0; j < 16; j += 4) { ce> > - if ((*(u_int32_t *)&sin6->sin6_addr.s6_addr[j] & *(u_int32_t *)&m6p->sin6_addr.s6_addr[j]) ce> > -!= *(u_int32_t *)&a6p->sin6_addr.s6_addr[j]) { ce> > - ++reject; ce> > - break; ce> > - } ce> > + if (IN6_ARE_MASKED_ADDR_EQUAL(&sin6->sin6_addr, ce> > +&a6p->sin6_addr, &m6p->sin6_addr) != 0) { ce> > + ++reject; ce> > + break; ce> > } ce> > if (reject) { ce> > dprintf("rejected in rule %d due to IP mismatch.\n", i); ce> ce> The new check isn't a loop, so the 'break' breaks out of the outer ce> loop, which is unintentional. I think we should just remove 'break'. ce> ce> This was found by Coverity CID 1366941. Oh, it was my mistake. Thank you for pointing out it. Fixed in r310035 just now. -- Hiroki pgpYKLuSGGmZY.pgp Description: PGP signature
svn commit: r351482 - head/sys/dev/vmware/vmci
Author: hrs Date: Sun Aug 25 18:46:10 2019 New Revision: 351482 URL: https://svnweb.freebsd.org/changeset/base/351482 Log: Add MODULE_PNP_INFO() to vmci(4). This allows devd(8) to load the kernel module automatically when FreeBSD is running on VMware. Reviewed by: mp Differential Revision:https://reviews.freebsd.org/D21182 Modified: head/sys/dev/vmware/vmci/vmci.c Modified: head/sys/dev/vmware/vmci/vmci.c == --- head/sys/dev/vmware/vmci/vmci.c Sun Aug 25 17:55:31 2019 (r351481) +++ head/sys/dev/vmware/vmci/vmci.c Sun Aug 25 18:46:10 2019 (r351482) @@ -73,6 +73,16 @@ static driver_t vmci_driver = { static devclass_t vmci_devclass; DRIVER_MODULE(vmci, pci, vmci_driver, vmci_devclass, 0, 0); MODULE_VERSION(vmci, VMCI_VERSION); +const struct { + uint16_t vendor; + uint16_t device; + const char *desc; +} vmci_ids[] = { + { VMCI_VMWARE_VENDOR_ID, VMCI_VMWARE_DEVICE_ID, + "VMware Virtual Machine Communication Interface" }, +}; +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, vmci, vmci_ids, +nitems(vmci_ids)); MODULE_DEPEND(vmci, pci, 1, 1, 1); @@ -112,10 +122,9 @@ static int vmci_probe(device_t dev) { - if (pci_get_vendor(dev) == VMCI_VMWARE_VENDOR_ID && - pci_get_device(dev) == VMCI_VMWARE_DEVICE_ID) { - device_set_desc(dev, - "VMware Virtual Machine Communication Interface"); + if (pci_get_vendor(dev) == vmci_ids[0].vendor && + pci_get_device(dev) == vmci_ids[0].device) { + device_set_desc(dev, vmci_ids[0].desc); return (BUS_PROBE_DEFAULT); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r351483 - head/share/man/man7
Author: hrs Date: Sun Aug 25 18:52:10 2019 New Revision: 351483 URL: https://svnweb.freebsd.org/changeset/base/351483 Log: Document soft updates journaling and GEOM-based UFS journaling. Reviewed by: mckusick Modified: head/share/man/man7/ffs.7 Modified: head/share/man/man7/ffs.7 == --- head/share/man/man7/ffs.7 Sun Aug 25 18:46:10 2019(r351482) +++ head/share/man/man7/ffs.7 Sun Aug 25 18:52:10 2019(r351483) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 26, 2001 +.Dd August 25, 2019 .Dt FFS 7 .Os .Sh NAME @@ -46,6 +46,7 @@ In the kernel configuration file: .Cd "options UFS_DIRHASH" .Cd "options UFS_EXTATTR" .Cd "options UFS_EXTATTR_AUTOSTART" +.Cd "options UFS_GJOURNAL" .Pp In .Xr fstab 5 : @@ -84,20 +85,65 @@ and enforces metadata update dependencies (e.g., updating free block maps) to ensure that the file system remains consistent. .Pp -To enable soft updates on an -.Em unmounted -file system, use the following command: +To create a new file system with the soft updates +enabled, +use +.Xr newfs 8 +command: .Pp -.D1 Nm tunefs Fl n Cm enable Ar fs +.D1 Nm newfs Fl U Ar fs .Pp .Ar fs can be either a mount point listed in .Xr fstab 5 -(e.g., -.Pa /usr ) , +.Pq e.g. , Pa /usr , or a disk device -(e.g., -.Pa /dev/da0a ) . +.Pq e.g., Pa /dev/da0a . +.Pp +It is possible to enable soft updates on an +.Em unmounted +file system by using +.Xr tunefs 8 +command: +.Pp +.D1 Nm tunefs Fl n Cm enable Ar fs +.Pp +Soft updates can also add journaling that reduces the time spent by +.Xr fsck_ffs 8 +cleaning up a filesystem after a crash from several minutes to a few seconds. +The journal is placed in an inode named +.Pa .sujournal , +and is kept as a circular log of segments containing +records that describe metadata operations. +.Pp +To create a new file system with both the soft updates +and soft updates journaling enabled, +use the following command: +.Pp +.D1 Nm newfs Fl j Ar fs +.Pp +This runs +.Xr tunefs 8 +command after +.Xr newfs 8 +command with +.Fl U +flag enabled. +It is possible to enable soft updates journaling on an +.Em unmounted +file system by using +.Xr tunefs 8 +command: +.Pp +.D1 Nm tunefs Fl j Cm enable Ar fs +.Pp +This flag automatically enables the soft updates feature +when it is not enabled. +Note that this +.Xr tunefs 8 +command will fail if a file +.Pa .sujournal +already exists before enabling the soft updates journaling. .El .Ss File Ownership Inheritance .Bl -tag -width 2n @@ -155,10 +201,9 @@ extattrctl initattr -p / 388 posix1e.acl_default .Ed .Pp On the next mount of the root file system, -the attributes will be automatically started -(if +the attributes will be automatically started if .Dv UFS_EXTATTR_AUTOSTART -is included in the kernel configuration), +is included in the kernel configuration, and ACLs will be enabled. .Ss Directory Hashing .Bl -tag -width 2n @@ -183,7 +228,52 @@ subdirectory of the file system root during the mount If found, extended attribute support will be automatically started for that file system. .El +.Ss GEOM-based Journaling +.Bl -tag -width 2n +.It Cd "options UFS_GJOURNAL" +Implements a block level journaling of a UFS file system, +which is for both data and metadata. +To enable this, +create a +.Xr gjournal 8 +GEOM provider for a block device by using the +following command: .Pp +.D1 Nm gjournal label Ar da0 +.Pp +In this example, +.Pa /dev/da0 +is used as the target block device, +and +.Pa /dev/da0.journal +is created. +Then create a new file system by using +.Xr newfs 8 +with the block level journaling flag and mount it: +.Pp +.D1 Nm newfs Fl J Ar /dev/da0.journal +.D1 Nm mount Fl o Cm async Ar /dev/da0.journal Ar /mnt +.Pp +.Cm async +option is not mandatory but recommended for better performance +because the journaling guarantees the consistency of an +.Cm async +mount. +.Pp +It is also possible to enable the block level journaling +on an existing file system. +To do so, +use +.Xr gjournal 8 +utility to label the underlying block device and +.Xr tunefs 8 +utility to enable the block level journaling flag: +.Pp +.D1 Nm gjournal label Ar da0 +.D1 Nm tunefs Fl J Cm enable Ar /dev/da0.journal +.D1 Nm mount Fl o Cm async Ar /dev/da0.journal Ar /mnt +.El +.Ss Xr sysctl 8 MIBs The following .Xr sysctl 8 MIBs are defined for use with @@ -192,11 +282,11 @@ MIBs are defined for use with .It Va vfs.ffs.doasyncfree Asynchronously write out modified i-node and indirect blocks upon reallocating file system blocks to be contiguous. -(Default: 1.) +.Pq Default: 1 . .It Va vfs.ffs.doreallocblks Enable support for the rearrangement of blocks to be contiguous. -(Default: 1.) +.Pq Default: 1 . .El .Sh SEE ALSO .Xr quota 1 , @@ -204,7 +294,9 @@ to be contiguous. .Xr extattr 3 , .Xr edquota 8 , .Xr extattrctl 8 , -.Xr sysctl 8 +.Xr fsck_ffs 8 , +.Xr sysctl 8 , +.Xr tunefs 8 .Rs .%A M. McKusick .%A W. Joy @@ -
Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests
Hi, Alan Somers wrote in <201908231522.x7nfmluj068...@repo.freebsd.org>: as> Author: asomers as> Date: Fri Aug 23 15:22:20 2019 as> New Revision: 351423 as> URL: https://svnweb.freebsd.org/changeset/base/351423 as> as> Log: as> ping6: Rename options for better consistency with ping as> as> Now equivalent options have the same flags, and nonequivalent options have as> different flags. This is a prelude to merging the two commands. as> as> Submitted by: Ján Sučan as> MFC: Never as> Sponsored by: Google LLC (Google Summer of Code 2019) as> Differential Revision:https://reviews.freebsd.org/D21345 I have an objection on renaming the existing option flags in ping6(8) for compatibility with ping(8). Is it sufficient to add INET6 support to ping(8) with consistent flags and keep CLI of ping6(8) backward compatible? People have used ping6(8) for >15 years, so it is too late to rename the flags. I do not think the renaming is useful if "ping -6 localhost" or "ping ::1" works. -- Hiroki pgpHeEsSuEm7_.pgp Description: PGP signature
svn commit: r351484 - head/etc/mtree
Author: hrs Date: Sun Aug 25 19:27:14 2019 New Revision: 351484 URL: https://svnweb.freebsd.org/changeset/base/351484 Log: Fix build (r351481). Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist == --- head/etc/mtree/BSD.tests.dist Sun Aug 25 18:52:10 2019 (r351483) +++ head/etc/mtree/BSD.tests.dist Sun Aug 25 19:27:14 2019 (r351484) @@ -821,8 +821,6 @@ .. link .. -mixer -.. mkdir .. mkfifo @@ -1081,6 +1079,8 @@ fstyp .. makefs +.. +mixer .. newsyslog .. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests
Alan Somers wrote in : as> On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato wrote: as> > as> > Hi, as> > as> > Alan Somers wrote as> > in <201908231522.x7nfmluj068...@repo.freebsd.org>: as> > as> > as> Author: asomers as> > as> Date: Fri Aug 23 15:22:20 2019 as> > as> New Revision: 351423 as> > as> URL: https://svnweb.freebsd.org/changeset/base/351423 as> > as> as> > as> Log: as> > as> ping6: Rename options for better consistency with ping as> > as> as> > as> Now equivalent options have the same flags, and nonequivalent options have as> > as> different flags. This is a prelude to merging the two commands. as> > as> as> > as> Submitted by: Ján Sučan as> > as> MFC: Never as> > as> Sponsored by: Google LLC (Google Summer of Code 2019) as> > as> Differential Revision:https://reviews.freebsd.org/D21345 as> > as> > I have an objection on renaming the existing option flags in ping6(8) as> > for compatibility with ping(8). as> > as> > Is it sufficient to add INET6 support to ping(8) with consistent as> > flags and keep CLI of ping6(8) backward compatible? People have used as> > ping6(8) for >15 years, so it is too late to rename the flags. I do as> > not think the renaming is useful if "ping -6 localhost" or "ping ::1" as> > works. as> > as> > -- Hiroki as> as> If ping works with inet6, then why would we want to keep a separate as> tool around? If it's just for the sake of people who don't want to or as> can't update scripts, would a version in ports suffice? Because removing (or renaming) it causes a POLA violation. Do we really have a strong, unavoidable reason to force people to rewrite their script now? This is still a fairly essential and actively used tool, not like rcp or rlogin. Although deprecating ping6(8) and removing it from the base system in the future release at some point may work, changing the existing interface will simply confuse people who have used IPv6 for a long time. In my understanding, the purpose to integrate ping(8) and ping6(8) into a single utility is to provide a consistent CLI and reduce duplicate code, not to break compatibility. -- Hiroki pgpZG78JkgiJT.pgp Description: PGP signature
Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests
Hi Alan and Conrad, I agree with the idea having ping6(8) as a hardlink to ping(8) to provide the historical ping6(8) behavior. Alan Somers wrote in : as> Jan (please keep him CCed on replies) has been musing about the same as> thing. That might satisfy everyone. Jan, would it be straightforward as> to implement? as> -Alan as> as> On Sun, Aug 25, 2019 at 5:51 PM Conrad Meyer wrote: as> > as> > Hi Alan, Hiroki, as> > as> > It would be pretty easy to install a `ping6` link to the `ping(8)` as> > binary with different option parsing (conditional on argv[0]). That as> > removes most of the issues of code and space duplication, I think? as> > And the goal would be for the 'ping6' name to retain option as> > compatibility with historical ping6. as> > as> > It's not an uncommon pattern; for example, 'id', 'groups', and as> > 'whoami' are all a single binary with multiple linked names. Another as> > example is Clang, which provides 'cc', 'c++', 'clang', 'clang-cpp', as> > 'clang++' and 'cpp' links to the same inode — and those have very as> > different behavior depending on argv[0]. as> > as> > It's less work than forcing the ping6 compatibility crowd to create a as> > port and doesn't hurt ping(8) much, AFAICT. Is it an acceptable as> > middle ground? as> > as> > Best, as> > Conrad as> > as> > On Sun, Aug 25, 2019 at 1:26 PM alan somers wrote: as> > > as> > > On Sun, Aug 25, 2019, 2:11 PM Hiroki Sato wrote: as> > >> as> > >> Alan Somers wrote as> > >> in : as> > >> as> > >> as> On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato wrote: as> > >> as> > as> > >> as> > Hi, as> > >> as> > as> > >> as> > Alan Somers wrote as> > >> as> > in <201908231522.x7nfmluj068...@repo.freebsd.org>: as> > >> as> > as> > >> as> > as> Author: asomers as> > >> as> > as> Date: Fri Aug 23 15:22:20 2019 as> > >> as> > as> New Revision: 351423 as> > >> as> > as> URL: https://svnweb.freebsd.org/changeset/base/351423 as> > >> as> > as> as> > >> as> > as> Log: as> > >> as> > as> ping6: Rename options for better consistency with ping as> > >> as> > as> as> > >> as> > as> Now equivalent options have the same flags, and nonequivalent options have as> > >> as> > as> different flags. This is a prelude to merging the two commands. as> > >> as> > as> as> > >> as> > as> Submitted by: Ján Sučan as> > >> as> > as> MFC: Never as> > >> as> > as> Sponsored by: Google LLC (Google Summer of Code 2019) as> > >> as> > as> Differential Revision: https://reviews.freebsd.org/D21345 as> > >> as> > as> > >> as> > I have an objection on renaming the existing option flags in ping6(8) as> > >> as> > for compatibility with ping(8). as> > >> as> > as> > >> as> > Is it sufficient to add INET6 support to ping(8) with consistent as> > >> as> > flags and keep CLI of ping6(8) backward compatible? People have used as> > >> as> > ping6(8) for >15 years, so it is too late to rename the flags. I do as> > >> as> > not think the renaming is useful if "ping -6 localhost" or "ping ::1" as> > >> as> > works. as> > >> as> > as> > >> as> > -- Hiroki as> > >> as> as> > >> as> If ping works with inet6, then why would we want to keep a separate as> > >> as> tool around? If it's just for the sake of people who don't want to or as> > >> as> can't update scripts, would a version in ports suffice? as> > >> as> > >> Because removing (or renaming) it causes a POLA violation. Do we as> > >> really have a strong, unavoidable reason to force people to rewrite as> > >> their script now? This is still a fairly essential and actively used as> > >> tool, not like rcp or rlogin. Although deprecating ping6(8) and as> > >> removing it from the base system in the future release at some point as> > >> may work, changing the existing interface will simply confuse people as> > >> who have used IPv6 for a long time. as> > >> as> > >> In my understanding, the purpose to integrate ping(8) and ping6(8) as> > >> into a single utility is to provide a consistent CLI and reduce as> > >> duplicate code, not to break compatibility. as> > >> as> > >> -- Hiroki as> > > as> > > as> > > Those goals are incompatible. We can't provide a consistent CLI without breaking compatibility because ping and ping6 have conflicting options. And we can't keep ping6 around while also removing duplicate code because that would be, well, duplicate code. as> > > as> > > When would be a better time than a major version bump to make a change like this? as> > > as> > > The lack of a ping6 command in freebsd 13 should serve as a pretty obvious reminder that scripts will need updating. I think that putting a version of ping6 in ports should be a sufficient crutch for those who need it, don't you? as> as> -- Hiroki pgpR6bEWk2raL.pgp Description: PGP signature
svn commit: r351554 - head/contrib/sendmail/src
Author: hrs Date: Tue Aug 27 20:11:45 2019 New Revision: 351554 URL: https://svnweb.freebsd.org/changeset/base/351554 Log: MFV r351553: Fix a problem which prevented -OServerSSLOptions or -OClientSSLOptions specified in the command-line option from working. This patch has been accepted by the upstream. Reviewed by and discussed with: gshapiro Modified: head/contrib/sendmail/src/conf.c head/contrib/sendmail/src/readcf.c Directory Properties: head/contrib/sendmail/ (props changed) Modified: head/contrib/sendmail/src/conf.c == --- head/contrib/sendmail/src/conf.cTue Aug 27 19:37:19 2019 (r351553) +++ head/contrib/sendmail/src/conf.cTue Aug 27 20:11:45 2019 (r351554) @@ -365,6 +365,20 @@ setdefaults(e) TLS_Srv_Opts = TLS_I_SRV; if (NULL == EVP_digest) EVP_digest = EVP_md5(); + Srv_SSL_Options = SSL_OP_ALL; + Clt_SSL_Options = SSL_OP_ALL +# ifdef SSL_OP_NO_SSLv2 + | SSL_OP_NO_SSLv2 +# endif +# ifdef SSL_OP_NO_TICKET + | SSL_OP_NO_TICKET +# endif + ; +# ifdef SSL_OP_TLSEXT_PADDING + /* SSL_OP_TLSEXT_PADDING breaks compatibility with some sites */ + Srv_SSL_Options &= ~SSL_OP_TLSEXT_PADDING; + Clt_SSL_Options &= ~SSL_OP_TLSEXT_PADDING; +# endif /* SSL_OP_TLSEXT_PADDING */ #endif /* STARTTLS */ #ifdef HESIOD_INIT HesiodContext = NULL; Modified: head/contrib/sendmail/src/readcf.c == --- head/contrib/sendmail/src/readcf.c Tue Aug 27 19:37:19 2019 (r351553) +++ head/contrib/sendmail/src/readcf.c Tue Aug 27 20:11:45 2019 (r351554) @@ -159,22 +159,6 @@ readcf(cfname, safe, e) FileName = cfname; LineNumber = 0; -#if STARTTLS - Srv_SSL_Options = SSL_OP_ALL; - Clt_SSL_Options = SSL_OP_ALL -# ifdef SSL_OP_NO_SSLv2 - | SSL_OP_NO_SSLv2 -# endif -# ifdef SSL_OP_NO_TICKET - | SSL_OP_NO_TICKET -# endif - ; -# ifdef SSL_OP_TLSEXT_PADDING - /* SSL_OP_TLSEXT_PADDING breaks compatibility with some sites */ - Srv_SSL_Options &= ~SSL_OP_TLSEXT_PADDING; - Clt_SSL_Options &= ~SSL_OP_TLSEXT_PADDING; -# endif /* SSL_OP_TLSEXT_PADDING */ -#endif /* STARTTLS */ if (DontLockReadFiles) sff |= SFF_NOLOCK; cf = safefopen(cfname, O_RDONLY, 0444, sff); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r352567 - head/usr.bin/quota
Author: hrs Date: Sat Sep 21 00:17:40 2019 New Revision: 352567 URL: https://svnweb.freebsd.org/changeset/base/352567 Log: Add a workaround for servers which respond RPC_PROGNOTREGISTERED to a clnt_create() call even when it is actually a program version mismatch. Normally the server is supposed to return RPC_PROGVERSMISMATCH when it supports the specified program but not support the specified version. Some filers return RPC_PROGNOTREGISTERED to RQUOTA v2 calls and FreeBSD does not retry with the old v1 calls. This change fixes this failure scenario. Submitted by: Jian-Bo Liao PR: 236179 Modified: head/usr.bin/quota/quota.c Modified: head/usr.bin/quota/quota.c == --- head/usr.bin/quota/quota.c Fri Sep 20 22:07:59 2019(r352566) +++ head/usr.bin/quota/quota.c Sat Sep 21 00:17:40 2019(r352567) @@ -606,7 +606,7 @@ getnfsquota(struct statfs *fst, struct quotause *qup, call_stat = callaurpc(host, RQUOTAPROG, EXT_RQUOTAVERS, RQUOTAPROC_GETQUOTA, (xdrproc_t)xdr_ext_getquota_args, (char *)&gq_args, (xdrproc_t)xdr_getquota_rslt, (char *)&gq_rslt); - if (call_stat == RPC_PROGVERSMISMATCH) { + if (call_stat == RPC_PROGVERSMISMATCH || call_stat == RPC_PROGNOTREGISTERED) { if (quotatype == USRQUOTA) { old_gq_args.gqa_pathp = cp + 1; old_gq_args.gqa_uid = id; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r352568 - head/usr.bin/top
Author: hrs Date: Sat Sep 21 00:44:37 2019 New Revision: 352568 URL: https://svnweb.freebsd.org/changeset/base/352568 Log: Impove wording and move descriptions about locale to LC_CTYPE in the ENVIRONMENT section. Modified: head/usr.bin/top/top.1 Modified: head/usr.bin/top/top.1 == --- head/usr.bin/top/top.1 Sat Sep 21 00:17:40 2019(r352567) +++ head/usr.bin/top/top.1 Sat Sep 21 00:44:37 2019(r352568) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd September 20, 2019 +.Dd September 21, 2019 .Dt TOP 1 .Os .Sh NAME @@ -66,6 +66,9 @@ It it useful when you want to watch applications, that puts their status information there. If the real name differs from argv[0], it will be displayed in parenthesis. +Non-printable characters in the command line are +encoded in C-style backslash sequences or +a three digit octal sequences. .It Fl b Use \*(lqbatch\*(rq mode. In this mode, all input from the terminal is @@ -192,10 +195,6 @@ or \*(lqall\*(rq. Boolean flags are toggles. A second specification of any of these options will negate the first. -.Pp -The display of command names changes according to the locale. -If command names displayed in the locale settings are recognized as -non-display characters, they are displayed in three digit octal sequence. .Sh "INTERACTIVE MODE" When .Nm @@ -426,6 +425,12 @@ bytes paged out to swap devices (last interval) .It Ev TOP Default set of arguments to .Nm . +.It Ev LC_CTYPE +The locale to use when displaying the +.Va argv +vector when +.Fl a +flag is specified. .El .Sh SEE ALSO .Xr kill 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r352570 - head/usr.sbin/rpc.statd
Author: hrs Date: Sat Sep 21 01:29:59 2019 New Revision: 352570 URL: https://svnweb.freebsd.org/changeset/base/352570 Log: Fix build errors of test.c, which had been broken for a long time. This is a temporary fix and should be converted to a complete test scenarios by using this tool. Modified: head/usr.sbin/rpc.statd/Makefile head/usr.sbin/rpc.statd/test.c Modified: head/usr.sbin/rpc.statd/Makefile == --- head/usr.sbin/rpc.statd/MakefileSat Sep 21 01:23:08 2019 (r352569) +++ head/usr.sbin/rpc.statd/MakefileSat Sep 21 01:29:59 2019 (r352570) @@ -20,7 +20,8 @@ sm_inter_svc.c: ${RPCSRC} sm_inter.h: ${RPCSRC} ${RPCGEN} -h -o ${.TARGET} ${.ALLSRC} -test: test.c - cc -o test test.c -lrpcsvc +test: test.o + ${CC} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} ${LIBADD:S/^/-l/} +CLEANFILES+= test test.o .include Modified: head/usr.sbin/rpc.statd/test.c == --- head/usr.sbin/rpc.statd/test.c Sat Sep 21 01:23:08 2019 (r352569) +++ head/usr.sbin/rpc.statd/test.c Sat Sep 21 01:29:59 2019 (r352570) @@ -1,14 +1,14 @@ - #ifndef lint static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ #include +#include +#include #include #include - /* Default timeout can be changed using clnt_control() */ static struct timeval TIMEOUT = { 25, 0 }; @@ -20,7 +20,8 @@ sm_stat_1(argp, clnt) static struct sm_stat_res res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_STAT, xdr_sm_name, argp, xdr_sm_stat_res, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_STAT, (xdrproc_t)xdr_sm_name, argp, + (xdrproc_t)xdr_sm_stat_res, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (&res); @@ -35,7 +36,8 @@ sm_mon_1(argp, clnt) static struct sm_stat_res res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_MON, xdr_mon, argp, xdr_sm_stat_res, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_MON, (xdrproc_t)xdr_mon, argp, + (xdrproc_t)xdr_sm_stat_res, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (&res); @@ -50,7 +52,8 @@ sm_unmon_1(argp, clnt) static struct sm_stat res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_UNMON, xdr_mon_id, argp, xdr_sm_stat, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_UNMON, (xdrproc_t)xdr_mon_id, argp, + (xdrproc_t)xdr_sm_stat, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (&res); @@ -65,7 +68,8 @@ sm_unmon_all_1(argp, clnt) static struct sm_stat res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_UNMON_ALL, xdr_my_id, argp, xdr_sm_stat, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_UNMON_ALL, (xdrproc_t)xdr_my_id, argp, + (xdrproc_t)xdr_sm_stat, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (&res); @@ -80,7 +84,8 @@ sm_simu_crash_1(argp, clnt) static char res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_SIMU_CRASH, xdr_void, argp, xdr_void, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_SIMU_CRASH, (xdrproc_t)xdr_void, argp, + (xdrproc_t)xdr_void, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return ((void *)&res); @@ -119,25 +124,20 @@ int main(int argc, char **argv) { /* Hostname given */ struct sm_stat_res *res; -if (res = sm_mon_1(&mon, cli)) -{ + +res = sm_mon_1(&mon, cli); +if (res) printf("Success!\n"); -} else -{ printf("Fail\n"); -} } else { -if (out = sm_simu_crash_1(&dummy, cli)) -{ +out = sm_simu_crash_1(&dummy, cli); +if (out) printf("Success!\n"); -} else -{ printf("Fail\n"); -} } return 0; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r352572 - head/usr.sbin/rpc.statd
Author: hrs Date: Sat Sep 21 12:33:41 2019 New Revision: 352572 URL: https://svnweb.freebsd.org/changeset/base/352572 Log: Fix warnings and set WARNS=6. Modified: head/usr.sbin/rpc.statd/Makefile head/usr.sbin/rpc.statd/file.c head/usr.sbin/rpc.statd/statd.c Modified: head/usr.sbin/rpc.statd/Makefile == --- head/usr.sbin/rpc.statd/MakefileSat Sep 21 01:39:49 2019 (r352571) +++ head/usr.sbin/rpc.statd/MakefileSat Sep 21 12:33:41 2019 (r352572) @@ -4,9 +4,7 @@ PROG= rpc.statd MAN= rpc.statd.8 SRCS= file.c sm_inter_svc.c sm_inter.h statd.c procs.c -CFLAGS+= -I. -WARNS?= 2 - +CFLAGS+= -I${.OBJDIR} LIBADD=rpcsvc CLEANFILES= sm_inter_svc.c sm_inter.h Modified: head/usr.sbin/rpc.statd/file.c == --- head/usr.sbin/rpc.statd/file.c Sat Sep 21 01:39:49 2019 (r352571) +++ head/usr.sbin/rpc.statd/file.c Sat Sep 21 12:33:41 2019 (r352572) @@ -201,8 +201,8 @@ void init_file(const char *filename) /* defective, re-create from scratch. */ if (!new_file) { -if ((status_file_len < HEADER_LEN) || (status_file_len - < (HEADER_LEN + sizeof(HostInfo) * status_info->noOfHosts)) ) +if ((status_file_len < (off_t)HEADER_LEN) || (status_file_len + < (off_t)(HEADER_LEN + sizeof(HostInfo) * status_info->noOfHosts)) ) { warnx("status file is corrupt"); new_file = TRUE; Modified: head/usr.sbin/rpc.statd/statd.c == --- head/usr.sbin/rpc.statd/statd.c Sat Sep 21 01:39:49 2019 (r352571) +++ head/usr.sbin/rpc.statd/statd.c Sat Sep 21 12:33:41 2019 (r352572) @@ -62,9 +62,9 @@ __FBSDID("$FreeBSD$"); int debug = 0; /* Controls syslog() calls for debug messages */ -char **hosts, *svcport_str = NULL; -int nhosts = 0; -int xcreated = 0; +static char **hosts, *svcport_str = NULL; +static int nhosts = 0; +static int xcreated = 0; static int mallocd_svcport = 0; static int *sock_fd; static int sock_fdcnt; @@ -86,7 +86,8 @@ main(int argc, char **argv) void *nc_handle; in_port_t svcport; int ch, i, s; - char *endptr, **hosts_bak; + char *endptr; + char **hosts_bak; int have_v6 = 1; int maxrec = RPC_MAXDATASIZE; int attempt_cnt, port_len, port_pos, ret; @@ -156,7 +157,7 @@ main(int argc, char **argv) if (hosts == NULL) out_of_mem(); - hosts[0] = "*"; + hosts[0] = strdup("*"); nhosts = 1; } else { hosts_bak = hosts; @@ -172,7 +173,7 @@ main(int argc, char **argv) hosts = hosts_bak; nhosts += 2; - hosts[nhosts - 2] = "::1"; + hosts[nhosts - 2] = strdup("::1"); } else { hosts_bak = realloc(hosts, (nhosts + 1) * sizeof(char *)); if (hosts_bak == NULL) { @@ -186,7 +187,7 @@ main(int argc, char **argv) hosts = hosts_bak; } } - hosts[nhosts - 1] = "127.0.0.1"; + hosts[nhosts - 1] = strdup("127.0.0.1"); } attempt_cnt = 1; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r352574 - head/usr.sbin/rpc.statd
Author: hrs Date: Sat Sep 21 13:34:06 2019 New Revision: 352574 URL: https://svnweb.freebsd.org/changeset/base/352574 Log: - Revert WARNS to 2 because of mismatch between (xdrproc_t) and xdr_void(). - Add prototype of from_addr(). Modified: head/usr.sbin/rpc.statd/Makefile head/usr.sbin/rpc.statd/procs.c Modified: head/usr.sbin/rpc.statd/Makefile == --- head/usr.sbin/rpc.statd/MakefileSat Sep 21 13:00:38 2019 (r352573) +++ head/usr.sbin/rpc.statd/MakefileSat Sep 21 13:34:06 2019 (r352574) @@ -7,6 +7,9 @@ SRCS= file.c sm_inter_svc.c sm_inter.h statd.c procs.c CFLAGS+= -I${.OBJDIR} LIBADD=rpcsvc +# XXX: mismatch between (xdrproc_t) and xdr_void(). +WARNS?=2 + CLEANFILES= sm_inter_svc.c sm_inter.h RPCSRC= ${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc/sm_inter.x Modified: head/usr.sbin/rpc.statd/procs.c == --- head/usr.sbin/rpc.statd/procs.c Sat Sep 21 13:00:38 2019 (r352573) +++ head/usr.sbin/rpc.statd/procs.c Sat Sep 21 13:34:06 2019 (r352574) @@ -52,9 +52,10 @@ __FBSDID("$FreeBSD$"); #include "statd.h" +static const char *from_addr(struct sockaddr *); + static const char * -from_addr(saddr) - struct sockaddr *saddr; +from_addr(struct sockaddr *saddr) { static char inet_buf[INET6_ADDRSTRLEN]; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r349875 - in head: share/man/man4 sys/dev/usb sys/dev/usb/net sys/dev/usb/quirk
Author: hrs Date: Wed Jul 10 05:45:50 2019 New Revision: 349875 URL: https://svnweb.freebsd.org/changeset/base/349875 Log: Add support for RTL8156, 2.5GbE USB network controller, to if_cdce(4). This chip can be found in Planex USB-LAN2500R. Modified: head/share/man/man4/cdce.4 head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/share/man/man4/cdce.4 == --- head/share/man/man4/cdce.4 Wed Jul 10 04:09:15 2019(r349874) +++ head/share/man/man4/cdce.4 Wed Jul 10 05:45:50 2019(r349875) @@ -28,7 +28,7 @@ .\" $NetBSD: cdce.4,v 1.4 2004/12/08 18:35:56 peter Exp $ .\" $FreeBSD$ .\" -.Dd May 21, 2018 +.Dd July 10, 2019 .Dt CDCE 4 .Os .Sh NAME @@ -89,6 +89,10 @@ Prolific PL-2501 Host-to-Host Bridge Controller Sharp Zaurus PDA .It Terayon TJ-715 DOCSIS Cable Modem +.It +Realtek RTL8156 USB GBE/2.5G Ethernet Family Controller +.It +Planex USB-LAN2500R .El .Sh DIAGNOSTICS .Bl -diag Modified: head/sys/dev/usb/net/if_cdce.c == --- head/sys/dev/usb/net/if_cdce.c Wed Jul 10 04:09:15 2019 (r349874) +++ head/sys/dev/usb/net/if_cdce.c Wed Jul 10 05:45:50 2019 (r349875) @@ -276,6 +276,7 @@ static const STRUCT_USB_HOST_ID cdce_host_devs[] = { {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLA300, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLC700, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLC750, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, + {USB_VPI(USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8156, 0)}, {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR), USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x16), Modified: head/sys/dev/usb/quirk/usb_quirk.c == --- head/sys/dev/usb/quirk/usb_quirk.c Wed Jul 10 04:09:15 2019 (r349874) +++ head/sys/dev/usb/quirk/usb_quirk.c Wed Jul 10 05:45:50 2019 (r349875) @@ -101,6 +101,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(ELSA, MODEM1, 0x, 0x, UQ_CFG_INDEX_1), USB_QUIRK(PLANEX2, MZKUE150N, 0x, 0x, UQ_CFG_INDEX_1), USB_QUIRK(CISCOLINKSYS, USB3GIGV1, 0x, 0x, UQ_CFG_INDEX_1), + USB_QUIRK(REALTEK, RTL8156, 0x, 0x, UQ_CFG_INDEX_2), /* Quirks for printer devices */ USB_QUIRK(HP, 895C, 0x, 0x, UQ_BROKEN_BIDIR), USB_QUIRK(HP, 880C, 0x, 0x, UQ_BROKEN_BIDIR), Modified: head/sys/dev/usb/usbdevs == --- head/sys/dev/usb/usbdevsWed Jul 10 04:09:15 2019(r349874) +++ head/sys/dev/usb/usbdevsWed Jul 10 05:45:50 2019(r349875) @@ -3962,6 +3962,7 @@ product REALTEK RTL8188RU_2 0x317f RTL8188RU product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet product REALTEK RTL81520x8152 RTL8152 USB Ethernet product REALTEK RTL81530x8153 RTL8153 USB Ethernet +product REALTEK RTL81560x8156 RTL8156 USB Ethernet product REALTEK RTL8188CE_0 0x8170 RTL8188CE product REALTEK RTL81710x8171 RTL8171 product REALTEK RTL81720x8172 RTL8172 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r362503 - head/share/man/man5
Eugene Grosbein wrote in <202006221752.05mhqend013...@repo.freebsd.org>: eu> Author: eugen eu> Date: Mon Jun 22 17:52:13 2020 eu> New Revision: 362503 eu> URL: https://svnweb.freebsd.org/changeset/base/362503 eu> eu> Log: eu> Followup to r362502: rc.conf(5): unobsolete gif_interfaces eu> eu> There are cases when gif_interfaces cannot be replaced eu> with cloned_interfaces, such as tunnels with external IPv6 addresses eu> and internal IPv4 or vice versa. Such configuration requires eu> extra invocation of ifconfig(8) and supported with gif_interfaces only. eu> eu> Fix manual page and provide some examples. eu> eu> MFC after:1 week eu> X-MFC-With: 362502 (snip) eu> +Additionally, this option ensures that each listed interface is created eu> +via the eu> +.Cm create eu> +option to eu> +.Xr ifconfig eu> +before attempting to configure it. eu> +.Pp eu> For example, configure two eu> .Xr gif eu> interfaces with: eu> -.Bd -literal -offset indent eu> +.Bd -literal eu> gif_interfaces="gif0 gif1" eu> -ifconfig_gif0="tunnel src_addr0 dst_addr0" eu> -ifconfig_gif1="tunnel src_addr1 dst_addr1" eu> +gifconfig_gif0="100.64.0.1 100.64.0.2" eu> +ifconfig_gif0="inet 10.0.0.1 10.0.0.2 netmask 255.255.255.252" eu> +gifconfig_gif1="inet6 2a00::1 2a01::1" eu> +ifconfig_gif1="inet 10.1.0.1 10.1.0.2 netmask 255.255.255.252" These cases should be able to express by the following: ifconfig_gif0="inet 10.0.0.1 10.0.0.2 netmask 255.255.255.252" ifconfig_gif0_alias0="inet tunnel 100.64.0.1 100.64.0.2" and ifconfig_gif1="inet 10.0.0.1 10.0.0.2 netmask 255.255.255.252" ifconfig_gif1_ipv6="inet6 auto_linklocal" ifconfig_gif1_alias0="inet6 tunnel 2a00::1 2a01::1" Could you show more examples which cannot be covered by cloned_interfaces + ifconfig_*? I lost track of the discussions in the past (sorry) but want to revisit this to understand what was the limitation because it should also affect gre(8) and other tunnel pseudo-interfaces. -- Hiroki pgpDVykp1HDGZ.pgp Description: PGP signature
svn commit: r362770 - head/share/ctypedef
Author: hrs Date: Mon Jun 29 03:23:13 2020 New Revision: 362770 URL: https://svnweb.freebsd.org/changeset/base/362770 Log: Fix CTYPE for ja_JP.eucJP and ja_JP.SJIS. PR: 163168 MFC after:3 days Modified: head/share/ctypedef/ja_JP.eucJP.src Modified: head/share/ctypedef/ja_JP.eucJP.src == --- head/share/ctypedef/ja_JP.eucJP.src Mon Jun 29 03:09:14 2020 (r362769) +++ head/share/ctypedef/ja_JP.eucJP.src Mon Jun 29 03:23:13 2020 (r362770) @@ -49,7 +49,6 @@ upper ;/ ;/ ;/ ;/ - ;/ ;/ ;/ ;/ @@ -73,7 +72,6 @@ upper ;/ ;/ ;/ ;/ - ;/ ;/ ;/ ;/ @@ -85,7 +83,6 @@ upper ;/ ;/ ;/ ;/ - ;/ ;/ ;/ ;/ @@ -101,7 +98,6 @@ upper;/ ;/ ;/ ;/ - ;/ ;/ ;/ ;/ @@ -126,45 +122,6 @@ upper ;/ ;/ ;/ ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ ;/ ;/ ;/ @@ -173,293 +130,86 @@ upper;/ ;/ ;/ ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ + ;/ ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;/ - ;
svn commit: r364245 - in head/tools/tools/locale: . etc/final-maps patch tools
Author: hrs Date: Sat Aug 15 07:19:37 2020 New Revision: 364245 URL: https://svnweb.freebsd.org/changeset/base/364245 Log: - Update to Unicode CLDR v35 (Unicode 12.0). - Update tools/tools/locale to add make targets to automatically generate locale source files. With this change, just typing "make obj && make -j4" will rebuild them. Check README for more details. - Fix issues in ja_JP ctypedef and range specification support in utf8-rollup.pl. - Add a temporary patch for UnicodeData.txt to fix code ranges of CJK Ideograph Extension A and Extension B. - tools/cldr2def.pl: Use eucJP for ja_JP ctypedef because eucJP is not compatible with UTF-8. - tools/convert_map.pl: Add a verbose error message. - tools/utf8-rollup.pl: Normalize entries to use Unicode, not UTF-8. Reviewed by: bapt Differential Revision:https://reviews.freebsd.org/D25503 Added: head/tools/tools/locale/patch/ head/tools/tools/locale/patch/patch-UnicodeData.txt (contents, props changed) Modified: head/tools/tools/locale/Makefile head/tools/tools/locale/README head/tools/tools/locale/etc/final-maps/map.UTF-8 head/tools/tools/locale/tools/cldr2def.pl head/tools/tools/locale/tools/convert_map.pl head/tools/tools/locale/tools/finalize head/tools/tools/locale/tools/utf8-rollup.pl Modified: head/tools/tools/locale/Makefile == --- head/tools/tools/locale/MakefileSat Aug 15 07:16:12 2020 (r364244) +++ head/tools/tools/locale/MakefileSat Aug 15 07:19:37 2020 (r364245) @@ -7,19 +7,30 @@ # # Modified by John Marino to suit DragonFly needs # +.if ${.CURDIR} == ${.OBJDIR} +.error Do make obj first. +.endif -.OBJDIR: . +LOCALESRCDIR?= ${DESTDIR}/usr/src/share +TMPDIR?= /tmp -.if !defined(UNIDIR) -.error UNIDIR is not set -.endif -PASSON=UNIDIR="${UNIDIR}" +BASEDIR= ${.CURDIR} +ETCDIR=${BASEDIR}/etc +TOOLSDIR= ${BASEDIR}/tools +PATCHDIR= ${BASEDIR}/patch +UNIDIR=${.OBJDIR:tA}/unicode -ETCDIR=${.CURDIR}/etc +PKGS= openjdk8 \ + apache-ant \ + p5-XML-Parser \ + p5-Tie-IxHash \ + p5-Text-Iconv +tools-test: + pkg info -e ${PKGS} + @echo tools ok. KNOWN= monetdef numericdef msgdef colldef ctypedef # timedef TYPES?=${KNOWN} -LOCALE_DESTDIR?= /tmp/generated-locales/ COLLATION_SPECIAL?= \ cs_CZ ISO8859-2 \ @@ -44,67 +55,81 @@ COLLATION_SPECIAL?= \ .for area enc in ${COLLATION_SPECIAL} COLLATIONS_SPECIAL_ENV+= ${area}.${enc} .endfor -PASSON+= COLLATIONS_SPECIAL="${COLLATIONS_SPECIAL_ENV}" +SETENV=env -i \ + PATH="${PATH}" \ + TMPDIR="${TMPDIR}" \ + COLLATIONS_SPECIAL="${COLLATIONS_SPECIAL_ENV}" \ + UNIDIR="${UNIDIR}" \ + BASEDIR="${BASEDIR}" \ + TOOLSDIR="${TOOLSDIR}" \ + ETCDIR="${ETCDIR}" -all: +all: posix build afterbuild +.ORDER: posix build afterbuild + +afterbuild: build + @echo "" + @find . -name *failed + .for t in ${TYPES} . if ${KNOWN:M${t}} - test -d ${t} || mkdir ${t} - make build-${t} +build: build-${t} +.ORDER: build-${t} afterbuild . endif .endfor - @echo "" - @find . -name *failed +diff: .for t in ${TYPES} +. if ${KNOWN:M${t}} +diff: diff-${t} +diff-${t}: + -/usr/bin/diff -ruN -x Makefile -x Makefile.depend \ + ${LOCALESRCDIR}/${t} ${t} +. endif +.endfor + +install: +.for t in ${TYPES} +. if ${KNOWN:M${t}} install: install-${t} install-${t}: -. if ${KNOWN:M${t}} - rm -rf ${.CURDIR}/${t}.draft - rm -f ${.CURDIR}/../../../share/${t}/Makefile - rm -f ${.CURDIR}/../../../share/${t}/*.src - mv ${.CURDIR}/${t}/* ${.CURDIR}/../../../share/${t}/ + cd ${LOCALESRCDIR}/${t} && \ + rm -f Makefile *.src && \ + install -c ${t}/* ${LOCALESRCDIR}/${t} . endif .endfor post-install: .for t in ${TYPES} . if ${KNOWN:M${t}} - (cd ${.CURDIR}/../../../share/${t} && \ - make && make install && make clean) + cd ${LOCALSRCDIR}/${t} && \ + make && make install && make clean . endif .endfor .for t in ${TYPES} -gen-${t}: - mkdir -p ${t} ${t}.draft - perl -I tools tools/cldr2def.pl \ - --unidir=$$(realpath ${UNIDIR}) \ - --etc=$$(realpath ${ETCDIR}) \ +CLEANDIRS+=${t} ${t}.draft +${t}: + mkdir -p ${t} ${t}.draft && \ + perl -I ${TOOLSDIR} ${TOOLSDIR}/cldr2def.pl \ + --unidir=${UNIDIR:tA} \ + --etc=${ETCDIR:tA} \ --type=${t} -build-${t}: gen-${t} - env ${PASSON} tools/finalize ${t} +build-${t}: ${t} + ${SETENV} OUTBASEDIR="${.OBJDIR}/${t}" ${TOOLSDIR}/finalize ${t} .endfor -gen-ctypedef: ctype-rollup -static-colldef: gen-colldef +static-colldef:
Re: svn commit: r364449 - head/bin/ls
Hi, Gordon Bergling wrote in <202008210620.07l6kc6m091...@repo.freebsd.org>: gb> Author: gbe (doc committer) gb> Date: Fri Aug 21 06:20:11 2020 gb> New Revision: 364449 gb> URL: https://svnweb.freebsd.org/changeset/base/364449 gb> gb> Log: gb> ls(1): Update POSIX conformance from 2001 to 2008 gb> gb> - Update the options that are non-existing in POSIX from 2001 to 2008 gb> - Update POSIX conformance in the STANDARDS section from 2001 to 2008 Generally speaking, conformance with POSIX.1-2001 (SUSv3) and POSIX.1-2008 (SUSv4) are independent, so a simple replacement by s/2001/2008/ removes the former information. If we want to describe -2008, please add it instead of replacing the prior version numbers. -- Hiroki pgpOirpYjyNd7.pgp Description: PGP signature
Re: svn commit: r364449 - head/bin/ls
Gordon Bergling wrote in <20200824085223.ga28...@lion.0xfce3.net>: gb> thanks for your feedback. I can only define POSIX.1-200{1,8} or -susv4. So what gb> do you think about the following STANDARDS section? gb> gb> For the options that are non-existing I could correct them to -2001 and mention gb> also -susv4. gb> gb> STANDARDS gb> With the exception of options -g, -n and -o, the ls utility conforms to gb> IEEE Std 1003.1-2001 (“POSIX.1”) and Version 4 of the Single UNIX gb> Specification (“SUSv4”). The options -B, -D, -G, -I, -T, -U, -W, -Z, -b, gb> -h, -w, -y and -, are compatible extensions not defined in IEEE Std gb> 1003.1-2001 (“POSIX.1”). It might be a bit tedious, but just adding -2008 looks good to me like the following: |.St -p1003.1-2001 |and |.St -p1003.1-2008 . p1003.1-2004 is a subset of SUSv3 (and -2008 is one of SUSv4), so using p1003.1- consistently sounds less confusing when describing the conformance within the subsets. Regarding the non-standard extensions, I am not sure what "compatible" means. Some of them are extensions commonly seen on other BSD-derived OSes, some are available only on FreeBSD, and some have the same names with GNU's counterpart but different meanings. Is just mentioning "...are non-standard extensions" with no specification name sufficient and easier? I have no strong opinion on that part, but this is just my two cents. -- Hiroki pgpuwCQ3RKR27.pgp Description: PGP signature
svn commit: r368404 - head/tools/tools/locale
Author: hrs Date: Mon Dec 7 04:45:29 2020 New Revision: 368404 URL: https://svnweb.freebsd.org/changeset/base/368404 Log: Fix the source directory when installing the results. The install target did not install them actually. Spotted by: Thomas Munro, bapt, yuripv Modified: head/tools/tools/locale/Makefile Modified: head/tools/tools/locale/Makefile == --- head/tools/tools/locale/MakefileMon Dec 7 01:09:45 2020 (r368403) +++ head/tools/tools/locale/MakefileMon Dec 7 04:45:29 2020 (r368404) @@ -95,6 +95,7 @@ install: install-${t} install-${t}: cd ${LOCALESRCDIR}/${t} && \ rm -f Makefile *.src && \ + cd ${.OBJDIR} && \ install -c ${t}/* ${LOCALESRCDIR}/${t} . endif .endfor ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r358061 - head/share/vt/keymaps
Author: hrs Date: Tue Feb 18 01:50:44 2020 New Revision: 358061 URL: https://svnweb.freebsd.org/changeset/base/358061 Log: Use 0x5c for the scan code 0x7d. Japanese keyboards traditionally use 0x5c for both Japanese yen sign key and backslash key. While a Japanese yen sign is depicted on the keytop, most of Japanese expect that the scan code 0x7d gives a backslash (0x5c), not a Japanese yen sign (0xa5). This is because JIS X 0201 encoding (aka ISO/IEC 646-JA, an extended version of ASCII which is very popular in Japan) has Japanese yen sign at 0x5c and no backslash. On the other hand, ISO/IEC 8859-1 has Japanese yen sign at 0xa5. This difference has caused a confusion after Unicode became popular since ISO/IEC 10646 adopted 8859-1 for the plane 0. MFC after:1 week Modified: head/share/vt/keymaps/jp.capsctrl.kbd head/share/vt/keymaps/jp.kbd Modified: head/share/vt/keymaps/jp.capsctrl.kbd == --- head/share/vt/keymaps/jp.capsctrl.kbd Tue Feb 18 01:21:56 2020 (r358060) +++ head/share/vt/keymaps/jp.capsctrl.kbd Tue Feb 18 01:50:44 2020 (r358061) @@ -117,4 +117,4 @@ 115 '\''_'fs us '\''_'fs us O 121 ' '' 'nul' '' '' 'susp ' ' O 123 ' '' 'nul' '' '' 'susp ' ' O - 125 0xa5 '|'fs us 0xa5 '|'fs us O + 125 '\''|'fs us 0xa5 '|'fs us O Modified: head/share/vt/keymaps/jp.kbd == --- head/share/vt/keymaps/jp.kbdTue Feb 18 01:21:56 2020 (r358060) +++ head/share/vt/keymaps/jp.kbdTue Feb 18 01:50:44 2020 (r358061) @@ -115,4 +115,4 @@ 115 '\''_'fs us '\''_'fs us O 121 ' '' 'nul' '' '' 'susp ' ' O 123 ' '' 'nul' '' '' 'susp ' ' O - 125 0xa5 '|'fs us 0xa5 '|'fs us O + 125 '\''|'fs us 0xa5 '|'fs us O ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r358095 - in head: share/man/man4 sys/dev/acpica usr.sbin/acpi/acpiconf
a rate Battery present rate of charging or discharging. The unit of the value depends on .Va unit of .Vt struct acpi_bif . -.It cap +.It Va cap Battery remaining capacity. The unit of this value depends on .Va unit of .Vt struct acpi_bif . -.It volt +.It Va volt Battery present voltage. .El .El @@ -212,6 +304,8 @@ connected batteries: .It Va hw.acpi.battery.info_expire Information cache expiration time in seconds. The battery information obtained by +.Li _BIX +or .Li _BIF object will be stored and reused for successive read access to this MIB within the specified period. @@ -276,8 +370,11 @@ Battery information was changed. .An Munehiro Matsuda , .An Takanori Watanabe Aq Mt takaw...@freebsd.org , .An Mitsuru IWASAKI Aq Mt iwas...@freebsd.org , +.An Hans Petter Selasky Aq Mt hsela...@freebsd.org , and -.An Hans Petter Selasky Aq Mt hsela...@freebsd.org . +.An Hiroki Sato Aq Mt h...@freebsd.org . .Pp This manual page was written by -.An Takanori Watanabe Aq Mt takaw...@freebsd.org . +.An Takanori Watanabe Aq Mt takaw...@freebsd.org +and +.An Hiroki Sato Aq Mt h...@freebsd.org . Modified: head/sys/dev/acpica/acpi_battery.c == --- head/sys/dev/acpica/acpi_battery.c Wed Feb 19 04:46:41 2020 (r358094) +++ head/sys/dev/acpica/acpi_battery.c Wed Feb 19 06:28:55 2020 (r358095) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); /* Default seconds before re-sampling the battery state. */ #defineACPI_BATTERY_INFO_EXPIRE5 -static int acpi_batteries_initted; +static int acpi_batteries_initialized; static int acpi_battery_info_expire = ACPI_BATTERY_INFO_EXPIRE; static struct acpi_battinfo acpi_battery_battinfo; static struct sysctl_ctx_list acpi_battery_sysctl_ctx; @@ -65,11 +65,10 @@ acpi_battery_register(device_t dev) { int error; -error = 0; ACPI_SERIAL_BEGIN(battery); -if (!acpi_batteries_initted) - error = acpi_battery_init(); +error = acpi_battery_init(); ACPI_SERIAL_END(battery); + return (error); } @@ -107,11 +106,12 @@ acpi_battery_bst_valid(struct acpi_bst *bst) bst->cap != ACPI_BATT_UNKNOWN && bst->volt != ACPI_BATT_UNKNOWN); } -/* Check _BIF results for validity. */ +/* Check _BI[FX] results for validity. */ int -acpi_battery_bif_valid(struct acpi_bif *bif) +acpi_battery_bix_valid(struct acpi_bix *bix) { -return (bif->lfcap != 0); + +return (bix->lfcap != 0); } /* Get info about one or all batteries. */ @@ -123,7 +123,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba devclass_t batt_dc; device_t batt_dev; struct acpi_bst *bst; -struct acpi_bif *bif; +struct acpi_bix *bix; struct acpi_battinfo *bi; /* @@ -139,11 +139,11 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba /* * Allocate storage for all _BST data, their derived battinfo data, - * and the current battery's _BIF data. + * and the current battery's _BIX (or _BIF) data. */ bst = malloc(devcount * sizeof(*bst), M_TEMP, M_WAITOK | M_ZERO); bi = malloc(devcount * sizeof(*bi), M_TEMP, M_WAITOK | M_ZERO); -bif = malloc(sizeof(*bif), M_TEMP, M_WAITOK | M_ZERO); +bix = malloc(sizeof(*bix), M_TEMP, M_WAITOK | M_ZERO); /* * Pass 1: for each battery that is present and valid, get its status, @@ -173,12 +173,12 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba * Be sure we can get various info from the battery. */ if (ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || - ACPI_BATT_GET_INFO(batt_dev, bif) != 0) + ACPI_BATT_GET_INFO(batt_dev, bix, sizeof(*bix)) != 0) continue; /* If a battery is not installed, we sometimes get strange values. */ if (!acpi_battery_bst_valid(&bst[i]) || - !acpi_battery_bif_valid(bif)) + !acpi_battery_bix_valid(bix)) continue; /* @@ -197,18 +197,18 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba * is 0 (due to some error reading the battery), skip this * conversion. */ - if (bif->units == ACPI_BIF_UNITS_MA && bif->dvol != 0 && dev == NULL) { - bst[i].rate = (bst[i].rate * bif->dvol) / 1000; - bst[i].cap = (bst[i].cap * bif->dvol) / 1000; - bif->lfcap = (bif->lfcap * bif->dvol) / 1000; + if (bix->units == ACPI_BIX_UNITS_MA && bix->dvol != 0 && dev == NULL) { + bst[i].rate = (bst[i].rate * bix->dvol) / 1000; + bst[i].cap = (bst[i].cap * bix->dvol) / 1000; + bix->lfcap = (bix->lfcap * bix->dvol) / 1000; } /* -* The calculation above may set bif->lfcap to zero. This was +* The calculation above may set bix->
svn commit: r358152 - head/bin/sh
Author: hrs Date: Thu Feb 20 03:01:27 2020 New Revision: 358152 URL: https://svnweb.freebsd.org/changeset/base/358152 Log: Improve performance of "read" built-in command when using a seekable fd. The read built-in command calls read(2) with a 1-byte buffer because newline characters need to be detected even on a byte stream which comes from a non-seekable file descriptor. Because of this, the following script calls >6,000 read(2) to show a 6KiB file: while read IN; do echo "$IN"; done < /COPYRIGHT When the input byte stream is seekable, it is possible to read a data block and then reposition the file pointer to where a newline character found. This change adds a small buffer to do this and reduces the number of read(2) calls. Theoretically, multiple built-in commands reading the same seekable byte stream in a single pipe chain can share the buffer. However, this change just makes a single invocation of the read built-in allocate a buffer and deallocate it every time for simplicity. Although this causes read(2) to read the same regions multiple times, the performance penalty should be small compared to the reduction of read(2) calls. Reviewed by: jilles MFC after:1 week Differential Revision:https://reviews.freebsd.org/D23747 Modified: head/bin/sh/miscbltin.c Modified: head/bin/sh/miscbltin.c == --- head/bin/sh/miscbltin.c Thu Feb 20 01:45:55 2020(r358151) +++ head/bin/sh/miscbltin.c Thu Feb 20 03:01:27 2020(r358152) @@ -66,10 +66,79 @@ __FBSDID("$FreeBSD$"); #undef eflag +#defineREAD_BUFLEN 1024 +struct fdctx { + int fd; + size_t off;/* offset in buf */ + size_t buflen; + char*ep;/* tail pointer */ + charbuf[READ_BUFLEN]; +}; + +static void fdctx_init(int, struct fdctx *); +static void fdctx_destroy(struct fdctx *); +static ssize_t fdgetc(struct fdctx *, char *); int readcmd(int, char **); int umaskcmd(int, char **); int ulimitcmd(int, char **); +static void +fdctx_init(int fd, struct fdctx *fdc) +{ + off_t cur; + + /* Check if fd is seekable. */ + cur = lseek(fd, 0, SEEK_CUR); + *fdc = (struct fdctx){ + .fd = fd, + .buflen = (cur != -1) ? READ_BUFLEN : 1, + .ep = &fdc->buf[0], /* No data */ + }; +} + +static ssize_t +fdgetc(struct fdctx *fdc, char *c) +{ + ssize_t nread; + + if (&fdc->buf[fdc->off] == fdc->ep) { + nread = read(fdc->fd, fdc->buf, fdc->buflen); + if (nread > 0) { + fdc->off = 0; + fdc->ep = fdc->buf + nread; + } else + return (nread); + } + *c = fdc->buf[fdc->off++]; + + return (1); +} + +static void +fdctx_destroy(struct fdctx *fdc) +{ + size_t residue; + + if (fdc->buflen > 1) { + /* +* Reposition the file offset. Here is the layout of buf: +* +* | off +* v +* |*|---| +* buf ep buf+buflen +* |<- residue ->| +* +* off: current character +* ep: offset just after read(2) +* residue: length for reposition +*/ + residue = (fdc->ep - fdc->buf) - fdc->off; + if (residue > 0) + (void) lseek(fdc->fd, -residue, SEEK_CUR); + } +} + /* * The read builtin. The -r option causes backslashes to be treated like * ordinary characters. @@ -108,6 +177,7 @@ readcmd(int argc __unused, char **argv __unused) fd_set ifds; ssize_t nread; int sig; + struct fdctx fdctx; rflag = 0; prompt = NULL; @@ -173,8 +243,9 @@ readcmd(int argc __unused, char **argv __unused) backslash = 0; STARTSTACKSTR(p); lastnonifs = lastnonifsws = -1; + fdctx_init(STDIN_FILENO, &fdctx); for (;;) { - nread = read(STDIN_FILENO, &c, 1); + nread = fdgetc(&fdctx, &c); if (nread == -1) { if (errno == EINTR) { sig = pendingsig; @@ -260,6 +331,7 @@ readcmd(int argc __unused, char **argv __unused) STARTSTACKSTR(p); lastnonifs = lastnonifsws = -1; } + fdctx_destroy(&fdctx); STACKSTRNUL(p); /* ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r358152 - head/bin/sh
Conrad Meyer wrote in : ce> Given the report and looking at the change, I suspect the problem is ce> the promotion of '-residue' from size_t (unsigned 32-bit on i386) to ce> off_t (signed 64-bit). Something like '-(off_t)residue' or even ce> 'off_t residue;' should fix it. Yes, r358235 is the correct fix. I am sorry for the breakage and thank you for fixing it quickly. -- Hiroki pgp92rKm1UGc9.pgp Description: PGP signature
svn commit: r358395 - head/sys/dev/acpica
Author: hrs Date: Thu Feb 27 17:13:57 2020 New Revision: 358395 URL: https://svnweb.freebsd.org/changeset/base/358395 Log: Add workaround for models which do not follow the ACPI specification strictly. Extra objects are now simply ignored instead of rejecting everything. Modified: head/sys/dev/acpica/acpi_cmbat.c Modified: head/sys/dev/acpica/acpi_cmbat.c == --- head/sys/dev/acpica/acpi_cmbat.cThu Feb 27 16:51:41 2020 (r358394) +++ head/sys/dev/acpica/acpi_cmbat.cThu Feb 27 17:13:57 2020 (r358395) @@ -393,21 +393,34 @@ acpi_cmbat_get_bix(void *arg) } while (0) if (ACPI_PKG_VALID_EQ(res, 21)) { /* ACPI 6.0 _BIX */ - if (sc->bix.rev != ACPI_BIX_REV_1) + /* +* Some models have rev.0 _BIX with 21 members. +* In that case, treat the first 20 members as rev.0 _BIX. +*/ + if (sc->bix.rev != ACPI_BIX_REV_0 && + sc->bix.rev != ACPI_BIX_REV_1) ACPI_BIX_REV_MISMATCH_ERR(sc->bix.rev, ACPI_BIX_REV_1); } else if (ACPI_PKG_VALID_EQ(res, 20)) {/* ACPI 4.0 _BIX */ if (sc->bix.rev != ACPI_BIX_REV_0) ACPI_BIX_REV_MISMATCH_ERR(sc->bix.rev, ACPI_BIX_REV_0); - } else if (ACPI_PKG_VALID(res, 22) && - ACPI_BIX_REV_MIN_CHECK(sc->bix.rev, ACPI_BIX_REV_1 + 1)) { + } else if (ACPI_PKG_VALID(res, 22)) { + /* _BIX with 22 or more members. */ + if (ACPI_BIX_REV_MIN_CHECK(sc->bix.rev, ACPI_BIX_REV_1 + 1)) { /* -* Unknown _BIX with 22 or more members. +* Unknown revision number. * Assume 21 members are compatible with 6.0 _BIX. */ ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev), "Unknown _BIX revision(%u). " "Assuming compatible with revision %u.\n", sc->bix.rev, ACPI_BIX_REV_1); + } else { + /* +* Known revision number. Ignore the extra members. +*/ + ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev), + "Extra objects found in _BIX were ignored.\n"); + } } else { /* Invalid _BIX. Ignore it. */ ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev), ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r358402 - head/sys/dev/rtwn/pci
Author: hrs Date: Thu Feb 27 19:35:17 2020 New Revision: 358402 URL: https://svnweb.freebsd.org/changeset/base/358402 Log: Add MODULE_PNP_INFO() to autoload the rtwn_pci(4) kernel module. Reviewed by: imp MFC after:3 days Differential Revision:https://reviews.freebsd.org/D23807 Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.c head/sys/dev/rtwn/pci/rtwn_pci_attach.h Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.c == --- head/sys/dev/rtwn/pci/rtwn_pci_attach.c Thu Feb 27 19:07:10 2020 (r358401) +++ head/sys/dev/rtwn/pci/rtwn_pci_attach.c Thu Feb 27 19:35:17 2020 (r358402) @@ -96,15 +96,16 @@ static void rtwn_pci_attach_methods(struct rtwn_softc static const struct rtwn_pci_ident * rtwn_pci_probe_sub(device_t dev) { - const struct rtwn_pci_ident *ident; - int vendor_id, device_id; + int i, vendor_id, device_id; vendor_id = pci_get_vendor(dev); device_id = pci_get_device(dev); - for (ident = rtwn_pci_ident_table; ident->name != NULL; ident++) - if (vendor_id == ident->vendor && device_id == ident->device) - return (ident); + for (i = 0; i < nitems(rtwn_pci_ident_table); i++) { + if (vendor_id == rtwn_pci_ident_table[i].vendor && + device_id == rtwn_pci_ident_table[i].device) + return (&rtwn_pci_ident_table[i]); + } return (NULL); } @@ -788,6 +789,8 @@ static devclass_t rtwn_pci_devclass; DRIVER_MODULE(rtwn_pci, pci, rtwn_pci_driver, rtwn_pci_devclass, NULL, NULL); MODULE_VERSION(rtwn_pci, 1); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, rtwn, rtwn_pci_ident_table, +nitems(rtwn_pci_ident_table)); MODULE_DEPEND(rtwn_pci, pci, 1, 1, 1); MODULE_DEPEND(rtwn_pci, wlan, 1, 1, 1); MODULE_DEPEND(rtwn_pci, rtwn, 2, 2, 2); Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.h == --- head/sys/dev/rtwn/pci/rtwn_pci_attach.h Thu Feb 27 19:07:10 2020 (r358401) +++ head/sys/dev/rtwn/pci/rtwn_pci_attach.h Thu Feb 27 19:35:17 2020 (r358402) @@ -36,7 +36,6 @@ static const struct rtwn_pci_ident rtwn_pci_ident_tabl { 0x10ec, 0x8176, "Realtek RTL8188CE", RTWN_CHIP_RTL8192CE }, { 0x10ec, 0x8179, "Realtek RTL8188EE", RTWN_CHIP_RTL8188EE }, { 0x10ec, 0x8178, "Realtek RTL8192CE", RTWN_CHIP_RTL8192CE }, - { 0, 0, NULL, RTWN_CHIP_MAX_PCI } }; typedef void (*chip_pci_attach)(struct rtwn_pci_softc *); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r358404 - head/contrib/sendmail/src
Author: hrs Date: Thu Feb 27 19:40:29 2020 New Revision: 358404 URL: https://svnweb.freebsd.org/changeset/base/358404 Log: Fix broken STARTTLS when SharedMemoryKey is enabled. OpenSSL 1.1 API patch for sendmail had a bug which prevented sm_RSA_generate_key() function from working. This function is used to generate a temporary RSA key for a shared memory region used for TLS processing. Note that 12.0 and 12.1-RELEASE include this bug. This affects only if SM_CONF_SHM compile-time option (enabled by default) and SharedMemoryKey run-time option (not enabled by default) in a .cf file are specified. The latter corresponds to confSHARED_MEMORY_KEY in a .mc file. PR: 242861 MFC after:3 days Differential Revision:https://reviews.freebsd.org/D23734 Modified: head/contrib/sendmail/src/tls.c Modified: head/contrib/sendmail/src/tls.c == --- head/contrib/sendmail/src/tls.c Thu Feb 27 19:40:20 2020 (r358403) +++ head/contrib/sendmail/src/tls.c Thu Feb 27 19:40:29 2020 (r358404) @@ -745,18 +745,15 @@ sm_RSA_generate_key(num, e) { RSA *rsa = NULL; BIGNUM *bn_rsa_r4; - int rc; bn_rsa_r4 = BN_new(); -rc = BN_set_word(bn_rsa_r4, RSA_F4); - if ((bn_rsa_r4 != NULL) && BN_set_word(bn_rsa_r4, RSA_F4) && (rsa = RSA_new()) != NULL) + if ((bn_rsa_r4 != NULL) && BN_set_word(bn_rsa_r4, e) && (rsa = RSA_new()) != NULL) { - if (!RSA_generate_key_ex(rsa, RSA_KEYLENGTH, bn_rsa_r4, NULL)) + if (!RSA_generate_key_ex(rsa, num, bn_rsa_r4, NULL)) { RSA_free(rsa); rsa = NULL; } - return NULL; } BN_free(bn_rsa_r4); return rsa; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r358405 - head/contrib/tnftp/src
Author: hrs Date: Thu Feb 27 19:49:59 2020 New Revision: 358405 URL: https://svnweb.freebsd.org/changeset/base/358405 Log: Fix poor performance of ftp(1) due to small SO_SNDBUF and SO_RCVBUF. ftp(1) from vendor/tnftp always tried the following for every TCP connection: 1. Get the current buffer length of SO_SNDBUF and SO_RCVBUF by getsockopt(2). 2. Invoke setsockopt(2) to set them to the same values after checking if they are in a range between 8 KiB to 8 MiB. This behavior broke dynamic buffer sizing enabled by default (net.inet.tcp.{recv,send}buf_auto sysctls) and led to a very poor transfer rate. The fetch(1) utility does not have this problem. This change prevents SO_SNDBUF and SO_RCVBUF from configuring when the buffer auto-sizing is enabled unless the buffer sizes are explicitly specified. PR: 240827 Spotted by: Yuichiro NAITO MFC after:3 days Differential Revision:https://reviews.freebsd.org/D23732 Modified: head/contrib/tnftp/src/cmds.c head/contrib/tnftp/src/ftp_var.h head/contrib/tnftp/src/main.c head/contrib/tnftp/src/util.c Modified: head/contrib/tnftp/src/cmds.c == --- head/contrib/tnftp/src/cmds.c Thu Feb 27 19:40:29 2020 (r358404) +++ head/contrib/tnftp/src/cmds.c Thu Feb 27 19:49:59 2020 (r358405) @@ -2653,10 +2653,14 @@ setxferbuf(int argc, char *argv[]) goto usage; } - if (dir & RATE_PUT) + if (dir & RATE_PUT) { sndbuf_size = size; - if (dir & RATE_GET) + auto_sndbuf = 0; + } + if (dir & RATE_GET) { rcvbuf_size = size; + auto_rcvbuf = 0; + } fprintf(ttyout, "Socket buffer sizes: send %d, receive %d.\n", sndbuf_size, rcvbuf_size); code = 0; Modified: head/contrib/tnftp/src/ftp_var.h == --- head/contrib/tnftp/src/ftp_var.hThu Feb 27 19:40:29 2020 (r358404) +++ head/contrib/tnftp/src/ftp_var.hThu Feb 27 19:49:59 2020 (r358405) @@ -298,6 +298,8 @@ GLOBAL int options;/* used during socket creation */ GLOBAL int sndbuf_size;/* socket send buffer size */ GLOBAL int rcvbuf_size;/* socket receive buffer size */ +GLOBAL int auto_sndbuf;/* flag: if != 0 then use auto sndbuf size */ +GLOBAL int auto_rcvbuf;/* flag: if != 0 then use auto rcvbuf size */ GLOBAL int macnum; /* number of defined macros */ GLOBAL struct macel macros[16]; Modified: head/contrib/tnftp/src/main.c == --- head/contrib/tnftp/src/main.c Thu Feb 27 19:40:29 2020 (r358404) +++ head/contrib/tnftp/src/main.c Thu Feb 27 19:49:59 2020 (r358405) @@ -127,6 +127,9 @@ __RCSID(" NetBSD: main.c,v 1.117 2009/07/13 19:05:41 r #include #endif /* tnftp */ +#ifdef __FreeBSD__ +#include +#endif #defineGLOBAL /* force GLOBAL decls in ftp_var.h to be declared */ #include "ftp_var.h" @@ -509,6 +512,13 @@ main(int volatile argc, char **volatile argv) (void)xsignal(SIGUSR1, crankrate); (void)xsignal(SIGUSR2, crankrate); (void)xsignal(SIGWINCH, setttywidth); + + auto_rcvbuf = ((sysctlbyname("net.inet.tcp.recvbuf_auto", + &auto_rcvbuf, &(size_t []){[0] = sizeof(int)}[0], NULL, 0) == 0) && + auto_rcvbuf == 1); + auto_sndbuf = ((sysctlbyname("net.inet.tcp.sendbuf_auto", + &auto_sndbuf, &(size_t []){[0] = sizeof(int)}[0], NULL, 0) == 0) && + auto_sndbuf == 1); if (argc > 0) { if (isupload) { Modified: head/contrib/tnftp/src/util.c == --- head/contrib/tnftp/src/util.c Thu Feb 27 19:40:29 2020 (r358404) +++ head/contrib/tnftp/src/util.c Thu Feb 27 19:49:59 2020 (r358405) @@ -1087,13 +1087,27 @@ setupsockbufsize(int sock) sndbuf_size); } +#ifdef __FreeBSD__ + DPRINTF("auto_rcvbuf = %d\n", auto_rcvbuf); + if (auto_sndbuf == 0) { +#endif if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (void *)&sndbuf_size, sizeof(sndbuf_size)) == -1) warn("Unable to set sndbuf size %d", sndbuf_size); +#ifdef __FreeBSD__ + } +#endif +#ifdef __FreeBSD__ + DPRINTF("auto_sndbuf = %d\n", auto_sndbuf); + if (auto_rcvbuf == 0) { +#endif if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void *)&rcvbuf_size, sizeof(rcvbuf_size)) == -1) warn("Unable to set rcvbuf size %d", rcvbuf_size); +#ifdef __FreeBSD__ + } +#endif } /* ___ svn-src-head@freebsd.org mailing list http
Re: svn commit: r358411 - head/contrib/sendmail/src
Jung-uk Kim wrote in <8e60a869-fe1e-9314-ffdc-76ed3e2dc...@freebsd.org>: jk> > I merely try to understand how to unbreak upgrade path for 11.2-STABLE workstations jk> > with stock sendmail and SSL support that also has many ports installed including jk> > ports requiring new openssl API. Because buildworld fails and upgrade is broken. jk> I am also trying to understand your problem. Which port is specifically jk> requiring new OpenSSL API for you? The problem eugen@ is trying to explain is (correct me if this is wrong): 1. One needs to install OpenSSL from ports if she wants to install software which depends on it. deskutils/nextcloudclient, for example. Setting DEFAILT_VERSION+=ssl=openssl is strongly recommended in this case for consistency. 2. Handbook says enabling SMTP AUTH requires the following in make.conf: SENDMAIL_CFLAGS=-I/usr/local/include/sasl -DSASL SENDMAIL_LDFLAGS=-L/usr/local/lib SENDMAIL_LDADD=-lsasl2 However, this variables make the buildworld target to pick up OpenSSL from ports if installed, not from base, in the middle of building sendmail. "make buildworld" will always fail. There is no way to avoid OpenSSL from ports if she wants software such as deskutils/nextcloudclient. This build breakage occurs with sendmail + openssl from ports, not related to cyrus-sasl2. A shlib mismatch between sendmail and cyrus-sasl2 in terms of OpenSSL library is another issue. I think there are several workaround, but the primary problem is that people can get confused with instructions in the handbook. I suggest to update the handbook: a) If you do not have security/openssl on your system, set the following in make.conf and rebuilt the world: SENDMAIL_CFLAGS=-I/usr/local/include/sasl -DSASL SENDMAIL_LDFLAGS=-L/usr/local/lib SENDMAIL_LDADD=-lsasl2 b) If you have security/openssl, sendmail in the base system does not support SMTP AUTH because of incompatibility with the newer versions of OpenSSL. Use mail/sendmail from ports. I still feel that b) is sub-optimal, but it would be too complex to make them coexist with each other. The attached patch and putting SASLBASEDIR=/usr/local into /etc/make.conf instead of the SENDMAIL_* variables should mitigate the first problem but if security/cyrus-sasl2 was built with OpenSSL from ports, the shlib mismatch still occurs. -- Hiroki Index: usr.sbin/sendmail/Makefile === --- usr.sbin/sendmail/Makefile (revision 358301) +++ usr.sbin/sendmail/Makefile (working copy) @@ -72,3 +72,15 @@ ln -sf ${.ALLSRC} ${.TARGET} .include + +# libsasl2 support +.if defined(SASLBASEDIR) && exists(${SASLBASEDIR}) +${OBJS}: libsasl2.so sasl +libsasl2.so: + ln -s -f ${SASLBASEDIR}/lib/libsasl2.so ${.OBJDIR} +sasl: + ln -s -f ${SASLBASEDIR}/include/sasl ${.OBJDIR} +CLEANFILES+=libsasl2.so sasl +LDADD+= -lsasl2 -L. +CFLAGS+= -I. -DSASL +.endif pgpTKjfr1JDk5.pgp Description: PGP signature
svn commit: r358730 - in head: sys/netinet usr.bin/netstat
Author: hrs Date: Sat Mar 7 08:41:10 2020 New Revision: 358730 URL: https://svnweb.freebsd.org/changeset/base/358730 Log: Fix an issue of net.inet.igmp.stats handler. The header of (struct igmpstat) could be cleared by sysctl(3). This can be reproduced by "netstat -s -z -p igmp". PR: 244584 MFC after:1 week Modified: head/sys/netinet/igmp.c head/usr.bin/netstat/inet.c Modified: head/sys/netinet/igmp.c == --- head/sys/netinet/igmp.c Sat Mar 7 03:58:58 2020(r358729) +++ head/sys/netinet/igmp.c Sat Mar 7 08:41:10 2020(r358730) @@ -145,6 +145,7 @@ static void igmp_v3_suppress_group_record(struct in_mu static int sysctl_igmp_default_version(SYSCTL_HANDLER_ARGS); static int sysctl_igmp_gsr(SYSCTL_HANDLER_ARGS); static int sysctl_igmp_ifinfo(SYSCTL_HANDLER_ARGS); +static int sysctl_igmp_stat(SYSCTL_HANDLER_ARGS); static const struct netisr_handler igmp_nh = { .nh_name = "igmp", @@ -260,8 +261,9 @@ VNET_DEFINE_STATIC(int, igmp_default_version) = IGMP_V /* * Virtualized sysctls. */ -SYSCTL_STRUCT(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_VNET | CTLFLAG_RW, -&VNET_NAME(igmpstat), igmpstat, ""); +SYSCTL_PROC(_net_inet_igmp, IGMPCTL_STATS, stats, +CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_RW | CTLFLAG_MPSAFE, +&VNET_NAME(igmpstat), 0, sysctl_igmp_stat, "S,igmpstat", ""); SYSCTL_INT(_net_inet_igmp, OID_AUTO, recvifkludge, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_recvifkludge), 0, "Rewrite IGMPv1/v2 reports from 0.0.0.0 to contain subnet address"); @@ -333,6 +335,59 @@ igmp_restore_context(struct mbuf *m) #endif #endif return (m->m_pkthdr.flowid); +} + +/* + * IGMP statistics. + */ +static int +sysctl_igmp_stat(SYSCTL_HANDLER_ARGS) +{ + struct igmpstat igps0; + int error; + char *p; + + error = sysctl_wire_old_buffer(req, sizeof(V_igmpstat)); + if (error) + return (error); + + if (req->oldptr != NULL) { + if (req->oldlen < sizeof(V_igmpstat)) + error = ENOMEM; + else + error = SYSCTL_OUT(req, &V_igmpstat, + sizeof(V_igmpstat)); + } else + req->validlen = sizeof(V_igmpstat); + if (error) + goto out; + if (req->newptr != NULL) { + if (req->newlen < sizeof(V_igmpstat)) + error = ENOMEM; + else + error = SYSCTL_IN(req, &igps0, + sizeof(igps0)); + if (error) + goto out; + /* +* igps0 must be "all zero". +*/ + p = (char *)&igps0; + while (*p == '\0' && p < (char *)&igps0 + sizeof(igps0)) + p++; + if (p != (char *)&igps0 + sizeof(igps0)) { + error = EINVAL; + goto out; + } + /* +* Avoid overwrite of the version and length field. +*/ + igps0.igps_version = V_igmpstat.igps_version; + igps0.igps_len = V_igmpstat.igps_len; + bcopy(&igps0, &V_igmpstat, sizeof(V_igmpstat)); + } +out: + return (error); } /* Modified: head/usr.bin/netstat/inet.c == --- head/usr.bin/netstat/inet.c Sat Mar 7 03:58:58 2020(r358729) +++ head/usr.bin/netstat/inet.c Sat Mar 7 08:41:10 2020(r358730) @@ -1222,10 +1222,26 @@ void igmp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { struct igmpstat igmpstat; + int error, zflag0; if (fetch_stats("net.inet.igmp.stats", 0, &igmpstat, sizeof(igmpstat), kread) != 0) return; + /* +* Reread net.inet.igmp.stats when zflag == 1. +* This is because this MIB contains version number and +* length of the structure which are not set when clearing +* the counters. +*/ + zflag0 = zflag; + if (zflag) { + zflag = 0; + error = fetch_stats("net.inet.igmp.stats", 0, &igmpstat, + sizeof(igmpstat), kread); + zflag = zflag0; + if (error) + return; + } if (igmpstat.igps_version != IGPS_VERSION_3) { xo_warnx("%s: version mismatch (%d != %d)", __func__, ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r359046 - head/share/mk
Brooks Davis wrote in <202003171817.02hihwdy035...@repo.freebsd.org>: br> Author: brooks br> Date: Tue Mar 17 18:17:32 2020 br> New Revision: 359046 br> URL: https://svnweb.freebsd.org/changeset/base/359046 br> br> Log: br> Support SUBDIR.${MK_FOO}.${MK_BAR} expresssions. br> br> This allows simplification of Makefiles where some SUBDIR entries depend br> on two things (e.g. something that depends on C++ and some other knob). Just my two cents, but SUBDIR.${MK_FOO:M${MK_BAR}:M${MK_BAZ}}= dir should do the trick. I am not sure how many variables we need to support in practice, adding ".yes.yes..." in bsd.subdir.mk looks less flexible to me. br> Discussed with: imp, jhb br> Obtained from:CheriBSD br> MFC after:3 days br> Sponsored by: DARPA br> br> Modified: br> head/share/mk/bsd.subdir.mk br> br> Modified: head/share/mk/bsd.subdir.mk br> == br> --- head/share/mk/bsd.subdir.mk Tue Mar 17 17:28:12 2020 (r359045) br> +++ head/share/mk/bsd.subdir.mk Tue Mar 17 18:17:32 2020 (r359046) br> @@ -16,8 +16,8 @@ br> # br> # SUBDIR A list of subdirectories that should be built as well. br> # Each of the targets will execute the same target in the br> -# subdirectories. SUBDIR.yes is automatically appended br> -# to this list. br> +# subdirectories. SUBDIR.yes and SUBDIR.yes.yes are br> +# automatically appended to this list. br> # br> # +++ targets +++ br> # br> @@ -122,8 +122,8 @@ install:beforeinstall realinstall afterinstall br> # SUBDIR recursing may be disabled for MK_DIRDEPS_BUILD br> .if !target(_SUBDIR) br> br> -.if defined(SUBDIR) || defined(SUBDIR.yes) br> -SUBDIR:=${SUBDIR} ${SUBDIR.yes} br> +.if defined(SUBDIR) || defined(SUBDIR.yes) || defined(SUBDIR.yes.yes) br> +SUBDIR:=${SUBDIR} ${SUBDIR.yes} ${SUBDIR.yes.yes} br> SUBDIR:=${SUBDIR:u} br> .endif br> br> pgpOBMblJKJgk.pgp Description: PGP signature
svn commit: r359067 - head/share/examples/ipfw
Author: hrs Date: Wed Mar 18 08:00:46 2020 New Revision: 359067 URL: https://svnweb.freebsd.org/changeset/base/359067 Log: -F is GNU diff specific, not implemented in BSD diff. Reported by: ko...@ryuhoku.jp MFC after:3 days Modified: head/share/examples/ipfw/change_rules.sh Modified: head/share/examples/ipfw/change_rules.sh == --- head/share/examples/ipfw/change_rules.shWed Mar 18 05:28:36 2020 (r359066) +++ head/share/examples/ipfw/change_rules.shWed Mar 18 08:00:46 2020 (r359067) @@ -149,7 +149,7 @@ cat
svn commit: r359068 - in head: . libexec/rc/rc.d
Author: hrs Date: Wed Mar 18 08:17:24 2020 New Revision: 359068 URL: https://svnweb.freebsd.org/changeset/base/359068 Log: Remove /etc/host.conf, which was automatically generated from nsswitch.conf for backward compatibility. This file was used over 19 years ago, before introducing nsdispatch() in the name-service lookup APIs. MFC after:3 days Deleted: head/libexec/rc/rc.d/nsswitch Modified: head/ObsoleteFiles.inc head/libexec/rc/rc.d/Makefile Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Wed Mar 18 08:00:46 2020(r359067) +++ head/ObsoleteFiles.inc Wed Mar 18 08:17:24 2020(r359068) @@ -36,6 +36,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20200318: host.conf was deprecated a long time ago. +OLD_FILES+=etc/host.conf +OLD_FILES+=etc/rc.d/nsswitch + # 20200310: new clang import which bumps version from 9.0.1 to 10.0.0. OLD_FILES+=usr/lib/clang/9.0.1/include/cuda_wrappers/algorithm OLD_FILES+=usr/lib/clang/9.0.1/include/cuda_wrappers/complex Modified: head/libexec/rc/rc.d/Makefile == --- head/libexec/rc/rc.d/Makefile Wed Mar 18 08:00:46 2020 (r359067) +++ head/libexec/rc/rc.d/Makefile Wed Mar 18 08:17:24 2020 (r359068) @@ -74,7 +74,6 @@ CONFS=DAEMON \ nfsuserd \ nisdomain \ ${_nscd} \ - nsswitch \ ntpdate \ ${_opensm} \ os-release \ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r229818 - head/sys/kern
Author: hrs Date: Sun Jan 8 18:48:36 2012 New Revision: 229818 URL: http://svn.freebsd.org/changeset/base/229818 Log: Fix a typo. (s/nessesary/necessary/) Modified: head/sys/kern/kern_prot.c Modified: head/sys/kern/kern_prot.c == --- head/sys/kern/kern_prot.c Sun Jan 8 17:40:10 2012(r229817) +++ head/sys/kern/kern_prot.c Sun Jan 8 18:48:36 2012(r229818) @@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$"); #ifdef REGRESSION FEATURE(regression, -"Kernel support for interfaces nessesary for regression testing (SECURITY RISK!)"); +"Kernel support for interfaces necessary for regression testing (SECURITY RISK!)"); #endif #if defined(INET) || defined(INET6) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r230279 - head/usr.sbin/ypserv
Author: hrs Date: Tue Jan 17 20:39:33 2012 New Revision: 230279 URL: http://svn.freebsd.org/changeset/base/230279 Log: Revert changes in r228790. It prevented the ypserv daemon from working with with multiple socktypes. Modified: head/usr.sbin/ypserv/yp_main.c Modified: head/usr.sbin/ypserv/yp_main.c == --- head/usr.sbin/ypserv/yp_main.c Tue Jan 17 20:22:10 2012 (r230278) +++ head/usr.sbin/ypserv/yp_main.c Tue Jan 17 20:39:33 2012 (r230279) @@ -256,7 +256,6 @@ create_service(const int sock, const str const struct __rpc_sockinfo *si) { int error; - char *sname; SVCXPRT *transp; struct addrinfo hints, *res, *res0; @@ -264,7 +263,6 @@ create_service(const int sock, const str struct bindaddrlistent *blep; struct netbuf svcaddr; - sname = NULL; SLIST_INIT(&sle_head); memset(&hints, 0, sizeof(hints)); memset(&svcaddr, 0, sizeof(svcaddr)); @@ -344,6 +342,7 @@ create_service(const int sock, const str if (strncmp("0", servname, 1) == 0) { struct sockaddr *sap; socklen_t slen; + char *sname; sname = malloc(NI_MAXSERV); if (sname == NULL) { @@ -444,7 +443,6 @@ create_service(const int sock, const str } /* XXX: ignore error intentionally */ rpcb_set(YPPROG, YPVERS, nconf, &svcaddr); - free(sname); freeaddrinfo(res0); return 0; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r228790 - in head/usr.sbin: fwcontrol newsyslog ypserv
Eitan Adler wrote in <201112212027.pblkrfpk084...@svn.freebsd.org>: ea> Author: eadler (ports committer) ea> Date: Wed Dec 21 20:27:41 2011 ea> New Revision: 228790 ea> URL: http://svn.freebsd.org/changeset/base/228790 ea> ea> Log: ea> - Remove extraneous null ptr deref checks ea> - Fix memory leak ea> ea> Submitted by: Slono Slono ea> Approved by: jhb ea> MFC after:1 week ea> ea> Modified: ea> head/usr.sbin/fwcontrol/fwcontrol.c ea> head/usr.sbin/newsyslog/newsyslog.c ea> head/usr.sbin/ypserv/yp_main.c I suspects you did not test ypserv after this change. Freeing the pointer sname at the end of create_service() is completely wrong and probably people get the following error message when invoking ypserv: getaddrinfo(): servname not supported for ai_socktype -- Hiroki pgpa3Lywevy6A.pgp Description: PGP signature
Re: svn commit: r230354 - head/usr.sbin/makefs
Eitan Adler wrote in <201201200138.q0k1csou016...@svn.freebsd.org>: ea> Author: eadler ea> Date: Fri Jan 20 01:38:28 2012 ea> New Revision: 230354 ea> URL: http://svn.freebsd.org/changeset/base/230354 ea> ea> Log: ea> Fix a variety of warnings when compiling with gcc46 ea> ea> Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) ea> MFC after:3 days ea> ea> Modified: ea> head/usr.sbin/makefs/cd9660.c Removing the dot handling part and leaving a comment in lines 1106-1117 make people confused. In addition to that, I personally don't think this should be removed because our cd9660.c is still based on NetBSD's one in any way---bugfixes on our side have been reported to the upstream and we will import useful changes from there if any. Although the current dot handling is useless, keeping the difference between the two small still has a meaning. -- Hiroki pgp3VYDCboamM.pgp Description: PGP signature
svn commit: r230453 - in head/etc: . rc.d
Author: hrs Date: Sun Jan 22 10:57:32 2012 New Revision: 230453 URL: http://svn.freebsd.org/changeset/base/230453 Log: Fix several glitches in IPv6-related knobs: - ipv6_enable + ipv6_gateway_enable should unset ACCEPT_RTADV by default for backward compatibility. - Configurations in ipv6_prefix_IF should be recognized even if there is no ifconfig_IF_ipv6. - DAD wait should be performed at once, not on a per-interface basis, if possible. This fixes an issue that a system with a lot of IPv6-capable interfaces takes too long for booting. MFC after:1 week Modified: head/etc/network.subr head/etc/rc.d/netif Modified: head/etc/network.subr == --- head/etc/network.subr Sun Jan 22 10:41:58 2012(r230452) +++ head/etc/network.subr Sun Jan 22 10:57:32 2012(r230453) @@ -109,8 +109,10 @@ ifconfig_up() # backward compatibility: $ipv6_enable case $ipv6_enable in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - _ipv6_opts="${_ipv6_opts} accept_rtadv" - ;; + if ! checkyesno ipv6_gateway_enable; then + _ipv6_opts="${_ipv6_opts} accept_rtadv" + fi + ;; esac case $ipv6_cpe_wanif in @@ -139,6 +141,14 @@ ifconfig_up() _cfg=0 fi + # $ipv6_prefix_IF will be handled in + # ipv6_prefix_hostid_addr_common(). + ifconfig_args=`get_if_var $1 ipv6_prefix_IF` + if [ -n "${ifconfig_args}" ]; then + ifconfig $1 inet6 -ifdisabled + _cfg=0 + fi + # backward compatibility: $ipv6_ifconfig_IF ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF` if [ -n "${ifconfig_args}" ]; then @@ -444,6 +454,12 @@ ipv6if() return 0 fi + # True if $ipv6_prefix_IF is defined. + _tmpargs=`get_if_var $_if ipv6_prefix_IF` + if [ -n "${_tmpargs}" ]; then + return 0 + fi + # backward compatibility: True if $ipv6_ifconfig_IF is defined. _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` if [ -n "${_tmpargs}" ]; then @@ -559,10 +575,6 @@ ipv6_up() ipv6_prefix_hostid_addr_common ${_if} alias && _ret=0 ipv6_accept_rtadv_up ${_if} && _ret=0 - # wait for DAD - sleep `${SYSCTL_N} net.inet6.ip6.dad_count` - sleep 1 - return $_ret } Modified: head/etc/rc.d/netif == --- head/etc/rc.d/netif Sun Jan 22 10:41:58 2012(r230452) +++ head/etc/rc.d/netif Sun Jan 22 10:57:32 2012(r230453) @@ -123,16 +123,26 @@ network_common() _cooked_list="`list_net_interfaces`" fi + _dadwait= _fail= _ok= for ifn in ${_cooked_list}; do if ${_func} ${ifn} $2; then _ok="${_ok} ${ifn}" + if ipv6if ${ifn}; then + _dadwait=1 + fi else _fail="${_fail} ${ifn}" fi done + # inet6 address configuration needs sleep for DAD. + if [ -n "${_dadwait}" ]; then + sleep `${SYSCTL_N} net.inet6.ip6.dad_count` + sleep 1 + fi + _str= if [ -n "${_ok}" ]; then case ${_func} in ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r230458 - head/usr.bin/last
Author: hrs Date: Sun Jan 22 11:34:24 2012 New Revision: 230458 URL: http://svn.freebsd.org/changeset/base/230458 Log: - Replace "wtmp" with "utx.log" because last(1) no longer reads wtmp. - A real filename is now shown in an output report when "-f file" is specified. - Add Xr lastlogin into last(1) manual page. Reviewed by: ed MFC after:1 week Modified: head/usr.bin/last/last.1 head/usr.bin/last/last.c Modified: head/usr.bin/last/last.1 == --- head/usr.bin/last/last.1Sun Jan 22 11:20:42 2012(r230457) +++ head/usr.bin/last/last.1Sun Jan 22 11:34:24 2012(r230458) @@ -198,6 +198,7 @@ login data base .El .Sh SEE ALSO .Xr lastcomm 1 , +.Xr lastlogin 8 , .Xr getutxent 3 , .Xr ac 8 .Sh HISTORY Modified: head/usr.bin/last/last.c == --- head/usr.bin/last/last.cSun Jan 22 11:20:42 2012(r230457) +++ head/usr.bin/last/last.cSun Jan 22 11:34:24 2012(r230458) @@ -83,7 +83,7 @@ struct idtab { static const char *crmsg;/* cause of last reboot */ static time_t currentout; /* current logout value */ static longmaxrec; /* records to display */ -static const char *file = NULL; /* wtmp file */ +static const char *file = NULL; /* utx.log file */ static int sflag = 0; /* show delta in seconds */ static int width = 5; /* show seconds in delta */ static int yflag; /* show year */ @@ -194,7 +194,7 @@ main(int argc, char *argv[]) /* * wtmp -- - * read through the wtmp file + * read through the utx.log file */ static void wtmp(void) @@ -229,13 +229,13 @@ wtmp(void) doentry(&buf[--amount]); tm = localtime(&t); - (void) strftime(ct, sizeof(ct), "\nwtmp begins %+\n", tm); - printf("%s", ct); + (void) strftime(ct, sizeof(ct), "%+", tm); + printf("\n%s begins %s\n", ((file == NULL) ? "utx.log" : file), ct); } /* * doentry -- - * process a single wtmp entry + * process a single utx.log entry */ static void doentry(struct utmpx *bp) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r230354 - head/usr.sbin/makefs
Eitan Adler wrote in : ea> I was was unaware this code was contributed. I just looked at the ea> NetBSD version and I don't think it suffers from the same problem - ea> the loop appears to be used later. If that is because of some other Just checking, but the variables dot and semi are not used even in the NetBSD version since the initial import (in the NetBSD tree). What is "the same problem" you mentioned here? The problem I pointed out is just "removing the useless loop would be good but leaving the related comments is bad"... ea> bug fix which could be upstreamed that would be great. On the other ea> hand I would like to continue with my goal of making the non-contrib ea> world compilable with CC=gcc46. ea> ea> Should I revert this commit? I don't think it is needed. The makefs utility is a special case because it will probably diverge from the upstream to support FreeBSD-specific feature in the future (this is one of the reasons why it is not in contrib/). It didn't happen so far, however. By the way, does gcc46 no longer allow unused code? Generally speaking, I think it is enough to clean up unused code only when we actually change the code. -- Hiroki pgpj1b19w79Ov.pgp Description: PGP signature
Re: svn commit: r230353 - head/usr.sbin/makefs
Andreas Tobler wrote in <4f1f3585.8060...@freebsd.org>: an> Hi Eitan, an> an> On 20.01.12 02:38, Eitan Adler wrote: an> > Author: eadler an> > Date: Fri Jan 20 01:38:21 2012 an> > New Revision: 230353 an> > URL: http://svn.freebsd.org/changeset/base/230353 an> > an> > Log: an> >Fix warning when compiling with gcc46: an> >error: variable 'temp' set but not used an> > an> >Approved by: dim an> >Approved by: cperciva (mentor, blanket for pre-mentorship an> >already-approved commits) an> >MFC after: 3 days an> an> I do not know which of the makefs commits it was: an> an> [andreast@neon] /export/home/andreast/> makefs -t cd9660 -o chrp-boot an> -o rockridge -o label=pseries -B4321 p.iso /data1/netboot/powerpc64/ an> Segmentation fault (core dumped) an> an> [neon:~] andreast% uname -ra an> FreeBSD neon.andreas.nets 10.0-CURRENT FreeBSD 10.0-CURRENT #11 an> r230469M: Mon Jan 23 02:53:05 CET 2012 an> andre...@neon.andreas.nets:/usr/obj/export/devel/fbsd/head/src/sys/NEON an> amd64 an> an> Reverting to 230352 lets me create an iso. an> an> I compile makefs with the base compiler. an> an> I'll do some more investigations tomorrow, late night here. I got the same symptom and am investigating it. Can you rebuild the binary with a debug option like this: % cd /usr/src/usr.sbin/makefs % make clean % make DEBUG_FLAGS=-g % make DEBUG_FLAGS=-g install and then send me the output of the following command? % printf "run -t cd9660 -o chrp-boot -o rockridge -o label=pseries -B4321 p.iso /data1/netboot/powerpc64/\nbt\nf 1\n f 2\n" | gdb -x /dev/stdin -batch /usr/sbin/makefs In my environment both the old and the new version could reproduce it. I am not sure if mine is the same as yours at this moment, though. -- Hiroki pgp2knDZcCSXY.pgp Description: PGP signature
Re: svn commit: r230353 - head/usr.sbin/makefs
Andreas Tobler wrote in <4f1f94b3.6020...@freebsd.org>: an> On 25.01.12 01:40, Hiroki Sato wrote: an> > Andreas Tobler wrote an> >in<4f1f3585.8060...@freebsd.org>: an> > an> > an> Hi Eitan, an> > an> an> > an> On 20.01.12 02:38, Eitan Adler wrote: an> > an> > Author: eadler an> > an> > Date: Fri Jan 20 01:38:21 2012 an> > an> > New Revision: 230353 an> > an> > URL: http://svn.freebsd.org/changeset/base/230353 an> > an> > an> > an> > Log: an> > an> > Fix warning when compiling with gcc46: an> > an> > error: variable 'temp' set but not used an> > an> > an> > an> > Approved by: dim an> > an> > Approved by: cperciva (mentor, blanket for pre-mentorship an> > an> > already-approved commits) an> > an> > MFC after: 3 days an> > an> an> > an> I do not know which of the makefs commits it was: an> > an> an> > an> [andreast@neon] /export/home/andreast/> makefs -t cd9660 -o an> > chrp-boot an> > an> -o rockridge -o label=pseries -B4321 p.iso an> > /data1/netboot/powerpc64/ an> > an> Segmentation fault (core dumped) an> > an> an> > an> [neon:~] andreast% uname -ra an> > an> FreeBSD neon.andreas.nets 10.0-CURRENT FreeBSD 10.0-CURRENT #11 an> > an> r230469M: Mon Jan 23 02:53:05 CET 2012 an> > an> an> > andre...@neon.andreas.nets:/usr/obj/export/devel/fbsd/head/src/sys/NEON an> > an> amd64 an> > an> an> > an> Reverting to 230352 lets me create an iso. an> > an> an> > an> I compile makefs with the base compiler. an> > an> an> > an> I'll do some more investigations tomorrow, late night here. an> > an> > I got the same symptom and am investigating it. Can you rebuild the an> > binary with a debug option like this: an> > an> > % cd /usr/src/usr.sbin/makefs an> > % make clean an> > % make DEBUG_FLAGS=-g an> > % make DEBUG_FLAGS=-g install an> > an> > and then send me the output of the following command? an> > an> > % printf "run -t cd9660 -o chrp-boot -o rockridge -o label=pseries an> > % -B4321 p.iso /data1/netboot/powerpc64/\nbt\nf 1\n f 2\n" | gdb -x an> > % /dev/stdin -batch /usr/sbin/makefs an> > an> > In my environment both the old and the new version could reproduce an> > it. I am not sure if mine is the same as yours at this moment, an> > though. an> an> It is actually r230354, this is the commit which shows the failure. an> And I reverted back to 230353 and onfirmed that it 'works'. Thank you! I will investigating it. Actually my test data set can make SIGSEGV in both of the versions for some reason. I have to narrow down the cause, anyway. I guess your /data1/netboot/powerpc64/ is quite large, but can I receive the tarball of it in some way? It would be helpful. -- Hiroki pgplNpOsrjM4u.pgp Description: PGP signature
Re: svn commit: r230353 - head/usr.sbin/makefs
Andreas Tobler wrote in <4f1f9cd1.9070...@freebsd.org>: an> It is a powerpc64 crossbuild installation, built on amd64. It is an> around 650MB unzipped, 230MB zipped. I can upload it to freefall later an> this evening. Thanks! -- Hiroki pgpqPKxd9Ox3l.pgp Description: PGP signature
svn commit: r230529 - head/usr.sbin/makefs
Author: hrs Date: Wed Jan 25 07:45:15 2012 New Revision: 230529 URL: http://svn.freebsd.org/changeset/base/230529 Log: Fix a SIGSEGV problem in directory entry renaming. Modified: head/usr.sbin/makefs/cd9660.c Modified: head/usr.sbin/makefs/cd9660.c == --- head/usr.sbin/makefs/cd9660.c Wed Jan 25 07:14:23 2012 (r230528) +++ head/usr.sbin/makefs/cd9660.c Wed Jan 25 07:45:15 2012 (r230529) @@ -1086,6 +1086,8 @@ cd9660_rename_filename(cd9660node *iter, */ while (count < maxlength) { + if (*naming == ';') + break; naming++; count++; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r230353 - head/usr.sbin/makefs
Hiroki Sato wrote in <20120125.151236.688056751317619770@allbsd.org>: hr> Andreas Tobler wrote hr> in <4f1f9cd1.9070...@freebsd.org>: hr> hr> an> It is a powerpc64 crossbuild installation, built on amd64. It is hr> an> around 650MB unzipped, 230MB zipped. I can upload it to freefall later hr> an> this evening. hr> hr> Thanks! After this I could reproduce the problem in a smaller data set and identify the cause. I committed a fix in r230529. Please try it. -- Hiroki pgpqCeagWCDGi.pgp Description: PGP signature
svn commit: r222007 - head/etc/rc.d
Author: hrs Date: Tue May 17 07:40:13 2011 New Revision: 222007 URL: http://svn.freebsd.org/changeset/base/222007 Log: Remove redundant keywords. Submitted by: wxs Modified: head/etc/rc.d/ipfilter head/etc/rc.d/pf Modified: head/etc/rc.d/ipfilter == --- head/etc/rc.d/ipfilter Tue May 17 07:16:35 2011(r222006) +++ head/etc/rc.d/ipfilter Tue May 17 07:40:13 2011(r222007) @@ -23,7 +23,7 @@ resync_precmd="$stop_precmd" resync_cmd="ipfilter_resync" status_precmd="$stop_precmd" status_cmd="ipfilter_status" -extra_commands="reload resync status" +extra_commands="reload resync" required_modules="ipl:ipfilter" ipfilter_start() Modified: head/etc/rc.d/pf == --- head/etc/rc.d/pfTue May 17 07:16:35 2011(r222006) +++ head/etc/rc.d/pfTue May 17 07:40:13 2011(r222007) @@ -19,7 +19,7 @@ check_cmd="pf_check" reload_cmd="pf_reload" resync_cmd="pf_resync" status_cmd="pf_status" -extra_commands="check reload resync status" +extra_commands="check reload resync" required_files="$pf_rules" required_modules="pf" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r222711 - head/sbin/ifconfig
Author: hrs Date: Sun Jun 5 11:37:20 2011 New Revision: 222711 URL: http://svn.freebsd.org/changeset/base/222711 Log: Add the "nd6 options" line handler as af_other_status() of AF_INET6, not as an own address family. Reviewed by: bz Modified: head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/af_nd6.c Modified: head/sbin/ifconfig/af_inet6.c == --- head/sbin/ifconfig/af_inet6.c Sun Jun 5 11:20:19 2011 (r222710) +++ head/sbin/ifconfig/af_inet6.c Sun Jun 5 11:37:20 2011 (r222711) @@ -69,6 +69,7 @@ staticint explicit_prefix = 0; extern void setnd6flags(const char *, int, int, const struct afswtch *); extern void setnd6defif(const char *, int, int, const struct afswtch *); +extern void nd6_status(int); static char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/ @@ -519,6 +520,7 @@ static struct afswtch af_inet6 = { .af_status = in6_status, .af_getaddr = in6_getaddr, .af_getprefix = in6_getprefix, + .af_other_status = nd6_status, .af_postproc= in6_postproc, .af_status_tunnel = in6_status_tunnel, .af_settunnel = in6_set_tunnel, Modified: head/sbin/ifconfig/af_nd6.c == --- head/sbin/ifconfig/af_nd6.c Sun Jun 5 11:20:19 2011(r222710) +++ head/sbin/ifconfig/af_nd6.c Sun Jun 5 11:37:20 2011(r222711) @@ -63,6 +63,7 @@ static const char rcsid[] = static int isnd6defif(int); void setnd6flags(const char *, int, int, const struct afswtch *); void setnd6defif(const char *, int, int, const struct afswtch *); +void nd6_status(int); void setnd6flags(const char *dummyaddr __unused, @@ -136,64 +137,13 @@ isnd6defif(int s) return (ndifreq.ifindex == ifindex); } -static void +void nd6_status(int s) { struct in6_ndireq nd; - struct rt_msghdr *rtm; - size_t needed; - char *buf, *next; - int mib[6], ntry; int s6; int error; - int isinet6, isdefif; - - /* Check if the interface has at least one IPv6 address. */ - mib[0] = CTL_NET; - mib[1] = PF_ROUTE; - mib[2] = 0; - mib[3] = AF_INET6; - mib[4] = NET_RT_IFLIST; - mib[5] = if_nametoindex(ifr.ifr_name); - - /* Try to prevent a race between two sysctls. */ - ntry = 0; - do { - error = sysctl(mib, 6, NULL, &needed, NULL, 0); - if (error) { - warn("sysctl(NET_RT_IFLIST)/estimate"); - return; - } - buf = malloc(needed); - if (buf == NULL) { - warn("malloc for sysctl(NET_RT_IFLIST) failed"); - return; - } - if ((error = sysctl(mib, 6, buf, &needed, NULL, 0)) < 0) { - if (errno != ENOMEM || ++ntry >= MAX_SYSCTL_TRY) { - warn("sysctl(NET_RT_IFLIST)/get"); - free(buf); - return; - } - free(buf); - buf = NULL; - } - } while (buf == NULL); - - isinet6 = 0; - for (next = buf; next < buf + needed; next += rtm->rtm_msglen) { - rtm = (struct rt_msghdr *)next; - - if (rtm->rtm_version != RTM_VERSION) - continue; - if (rtm->rtm_type == RTM_NEWADDR) { - isinet6 = 1; - break; - } - } - free(buf); - if (!isinet6) - return; + int isdefif; memset(&nd, 0, sizeof(nd)); strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); @@ -215,19 +165,3 @@ nd6_status(int s) (unsigned int)(nd.ndi.flags | (isdefif << 15)), ND6BITS); putchar('\n'); } - -static struct afswtch af_nd6 = { - .af_name= "nd6", - .af_af = AF_LOCAL, - .af_other_status= nd6_status, -}; - -static __constructor void -nd6_ctor(void) -{ - - if (!feature_present("inet6")) - return; - - af_register(&af_nd6); -} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r222712 - head/sys/netinet6
Author: hrs Date: Sun Jun 5 11:40:30 2011 New Revision: 222712 URL: http://svn.freebsd.org/changeset/base/222712 Log: Use uint8_t for sockaddr sa_len. Reviewed by: bz Modified: head/sys/netinet6/send.h Modified: head/sys/netinet6/send.h == --- head/sys/netinet6/send.hSun Jun 5 11:37:20 2011(r222711) +++ head/sys/netinet6/send.hSun Jun 5 11:40:30 2011(r222712) @@ -33,7 +33,7 @@ #defineSND_IN 1 /* Incoming traffic. */ struct sockaddr_send { - unsigned char send_len; /* total length */ + uint8_t send_len; /* total length */ sa_family_t send_family;/* address family */ int send_direction; int send_ifidx; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r222728 - in head: sbin/ifconfig sys/netinet6
Author: hrs Date: Mon Jun 6 02:14:23 2011 New Revision: 222728 URL: http://svn.freebsd.org/changeset/base/222728 Log: - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. - A new per-interface knob IFF_ND6_NO_RADR and sysctl IPV6CTL_NO_RADR. This controls if accepting a route in an RA message as the default route. The default value for each interface can be set by net.inet6.ip6.no_radr. The system wide default value is 0. - A new sysctl: net.inet6.ip6.norbit_raif. This controls if setting R-bit in NA on RA accepting interfaces. The default is 0 (R-bit is set based on net.inet6.ip6.forwarding). Background: IPv6 host/router model suggests a router sends an RA and a host accepts it for router discovery. Because of that, KAME implementation does not allow accepting RAs when net.inet6.ip6.forwarding=1. Accepting RAs on a router can make the routing table confused since it can change the default router unintentionally. However, in practice there are cases where we cannot distinguish a host from a router clearly. For example, a customer edge router often works as a host against the ISP, and as a router against the LAN at the same time. Another example is a complex network configurations like an L2TP tunnel for IPv6 connection to Internet over an Ethernet link with another native IPv6 subnet. In this case, the physical interface for the native IPv6 subnet works as a host, and the pseudo-interface for L2TP works as the default IP forwarding route. Problem: Disabling processing RA messages when net.inet6.ip6.forwarding=1 and accepting them when net.inet6.ip6.forward=0 cause the following practical issues: - A router cannot perform SLAAC. It becomes a problem if a box has multiple interfaces and you want to use SLAAC on some of them, for example. A customer edge router for IPv6 Internet access service using an IPv6-over-IPv6 tunnel sometimes needs SLAAC on the physical interface for administration purpose; updating firmware and so on (link-local addresses can be used there, but GUAs by SLAAC are often used for scalability). - When a host has multiple IPv6 interfaces and it receives multiple RAs on them, controlling the default route is difficult. Router preferences defined in RFC 4191 works only when the routers on the links are under your control. Details of Implementation Changes: Router Advertisement messages will be accepted even when net.inet6.ip6.forwarding=1. More precisely, the conditions are as follow: (ACCEPT_RTADV && !NO_RADR && !ip6.forwarding) => Normal RA processing on that interface. (as IPv6 host) (ACCEPT_RTADV && (NO_RADR || ip6.forwarding)) => Accept RA but add the router to the defroute list with rtlifetime=0 unconditionally. This effectively prevents from setting the received router address as the box's default route. (!ACCEPT_RTADV) => No RA processing on that interface. ACCEPT_RTADV and NO_RADR are per-interface knob. In short, all interface are classified as "RA-accepting" or not. An RA-accepting interface always processes RA messages regardless of ip6.forwarding. The difference caused by NO_RADR or ip6.forwarding is whether the RA source address is considered as the default router or not. R-bit in NA on the RA accepting interfaces is set based on net.inet6.ip6.forwarding. While RFC 6204 W-1 rule (for CPE case) suggests a router should disable the R-bit completely even when the box has net.inet6.ip6.forwarding=1, I believe there is no technical reason with doing so. This behavior can be set by a new sysctl net.inet6.ip6.norbit_raif (the default is 0). Usage: # ifconfig fxp0 inet6 accept_rtadv => accept RA on fxp0 # ifconfig fxp0 inet6 accept_rtadv no_radr => accept RA on fxp0 but ignore default route information in it. # sysctl net.inet6.ip6.norbit_no_radr=1 => R-bit in NAs on RA accepting interfaces will always be set to 0. Modified: head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/af_nd6.c head/sys/netinet6/in6.h head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_var.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c Modified: head/sbin/ifconfig/af_inet6.c == --- head/sbin/ifconfig/af_inet6.c Mon Jun 6 01:53:31 2011 (r222727) +++ head/sbin/ifconfig/af_inet6.c Mon Jun 6 02:14:23 2011 (r222728) @@ -499,6 +499,8 @@ static struct cmd inet6_cmds[] = { DEF_CMD("-autoconf",-IN6_IFF_AUTOCONF, setip6flags), DEF_CMD("accept_rtadv", ND6_IFF_ACCEPT_RTADV, setnd6flags), DEF_CMD("-accept_rtadv",-ND6_IFF_ACCEPT_RTADV, setnd6flags
svn commit: r222730 - head/sys/netinet6
Author: hrs Date: Mon Jun 6 02:37:38 2011 New Revision: 222730 URL: http://svn.freebsd.org/changeset/base/222730 Log: - Make the code more proactively clear an ND6_IFF_IFDISABLED flag when an explicit action for INET6 configuration happens. The changes are: 1. When an ND6 flag is changed via SIOCSIFINFO_FLAGS ioctl, setting ND6_IFF_ACCEPT_RTADV and/or ND6_IFF_AUTO_LINKLOCAL now triggers an attempt to clear the ND6_IFF_IFDISABLED flag. 2. When an AF_INET6 address is added successfully to an interface and it is marked as ND6_IFF_IFDISABLED, an attempt to clear the ND6_IFF_IFDISABLED happens. This simplifies ND6_IFF_IFDISABLED flag manipulation by users via ifconfig(8); in most cases manual configuration is no longer needed. - When ND6_IFF_AUTO_LINKLOCAL is set and no link-local address is assigned to an interface, SIOCSIFINFO_FLAGS ioctl now calls in6_ifattach() to configure a link-local address. This change ensures link-local address configuration when "ifconfig IF inet6" command is invoked. For example, "ifconfig IF inet6 auto_linklocal" now always try to configure an LL addr even if ND6_IFF_AUTO_LINKLOCAL is already set to 1 (i.e. down/up cycle is no longer needed). Reviewed by: bz Modified: head/sys/netinet6/in6.c head/sys/netinet6/nd6.c Modified: head/sys/netinet6/in6.c == --- head/sys/netinet6/in6.c Mon Jun 6 02:25:53 2011(r222729) +++ head/sys/netinet6/in6.c Mon Jun 6 02:37:38 2011(r222730) @@ -652,8 +652,32 @@ in6_control(struct socket *so, u_long cm * that is, this address might make other addresses detached. */ pfxlist_onlink_check(); - if (error == 0 && ia) + if (error == 0 && ia) { + if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) { + /* +* Try to clear the flag when a new +* IPv6 address is added onto an +* IFDISABLED interface and it +* succeeds. +*/ + struct in6_ndireq nd; + + memset(&nd, 0, sizeof(nd)); + nd.ndi.flags = ND_IFINFO(ifp)->flags; + nd.ndi.flags &= ~ND6_IFF_IFDISABLED; + if (nd6_ioctl(SIOCSIFINFO_FLAGS, + (caddr_t)&nd, ifp) < 0) + log(LOG_NOTICE, "SIOCAIFADDR_IN6: " + "SIOCSIFINFO_FLAGS for -ifdisabled " + "failed."); + /* +* Ignore failure of clearing the flag +* intentionally. The failure means +* address duplication was detected. +*/ + } EVENTHANDLER_INVOKE(ifaddr_event, ifp); + } break; } Modified: head/sys/netinet6/nd6.c == --- head/sys/netinet6/nd6.c Mon Jun 6 02:25:53 2011(r222729) +++ head/sys/netinet6/nd6.c Mon Jun 6 02:37:38 2011(r222730) @@ -1322,6 +1322,15 @@ nd6_ioctl(u_long cmd, caddr_t data, stru struct ifaddr *ifa; struct in6_ifaddr *ia; + /* +* Try to clear ifdisabled flag when enabling +* accept_rtadv or auto_linklocal. +*/ + if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && + (ND.flags & (ND6_IFF_ACCEPT_RTADV | + ND6_IFF_AUTO_LINKLOCAL))) + ND.flags &= ~ND6_IFF_IFDISABLED; + if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && !(ND.flags & ND6_IFF_IFDISABLED)) { /* ifdisabled 1->0 transision */ @@ -1379,6 +1388,27 @@ nd6_ioctl(u_long cmd, caddr_t data, stru /* If no link-local address on ifp, configure */ ND_IFINFO(ifp)->flags |= ND6_IFF_AUTO_LINKLOCAL; in6_ifattach(ifp, NULL); + } else if (ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) { + /* +* When the IF already has +* ND6_IFF_AUTO_LINKLOCAL and no link-local +* address is assigned, try to assign one. +*/ + int haslinklocal = 0; + + IF_ADDR_LOCK(ifp); + TAILQ_FOR
svn commit: r222732 - in head: sys/netinet usr.sbin/rtadvd usr.sbin/rtsold
Author: hrs Date: Mon Jun 6 03:06:43 2011 New Revision: 222732 URL: http://svn.freebsd.org/changeset/base/222732 Log: - Implement RDNSS and DNSSL options (RFC 6106, IPv6 Router Advertisement Options for DNS Configuration) into rtadvd(8) and rtsold(8). DNS information received by rtsold(8) will go to resolv.conf(5) by resolvconf(8) script. This is based on work by J.R. Oldroyd (kern/156259) but revised extensively[1]. - rtadvd(8) now supports "noifprefix" to disable gathering on-link prefixes from interfaces when no "addr" is specified[2]. An entry in rtadvd.conf with "noifprefix" + no "addr" generates an RA message with no prefix information option. - rtadvd(8) now supports RTM_IFANNOUNCE message to fix crashes when an interface is added or removed. - Correct bogus ND_OPT_ROUTE_INFO value to one in RFC 4191. Reviewed by: bz[1] PR: kern/156259 [1] PR: bin/152458 [2] Modified: head/sys/netinet/icmp6.h head/usr.sbin/rtadvd/Makefile head/usr.sbin/rtadvd/advcap.c head/usr.sbin/rtadvd/config.c head/usr.sbin/rtadvd/config.h head/usr.sbin/rtadvd/dump.c head/usr.sbin/rtadvd/dump.h head/usr.sbin/rtadvd/if.c head/usr.sbin/rtadvd/if.h head/usr.sbin/rtadvd/pathnames.h head/usr.sbin/rtadvd/rrenum.c head/usr.sbin/rtadvd/rrenum.h head/usr.sbin/rtadvd/rtadvd.8 head/usr.sbin/rtadvd/rtadvd.c head/usr.sbin/rtadvd/rtadvd.conf head/usr.sbin/rtadvd/rtadvd.conf.5 head/usr.sbin/rtadvd/rtadvd.h head/usr.sbin/rtadvd/timer.c head/usr.sbin/rtadvd/timer.h head/usr.sbin/rtsold/Makefile head/usr.sbin/rtsold/dump.c head/usr.sbin/rtsold/if.c head/usr.sbin/rtsold/probe.c head/usr.sbin/rtsold/rtsock.c head/usr.sbin/rtsold/rtsol.c head/usr.sbin/rtsold/rtsold.8 head/usr.sbin/rtsold/rtsold.c head/usr.sbin/rtsold/rtsold.h Modified: head/sys/netinet/icmp6.h == --- head/sys/netinet/icmp6.hMon Jun 6 02:46:22 2011(r222731) +++ head/sys/netinet/icmp6.hMon Jun 6 03:06:43 2011(r222732) @@ -297,8 +297,9 @@ struct nd_opt_hdr { /* Neighbor discove #define ND_OPT_PREFIX_INFORMATION 3 #define ND_OPT_REDIRECTED_HEADER 4 #define ND_OPT_MTU 5 - -#define ND_OPT_ROUTE_INFO 200 /* draft-ietf-ipngwg-router-preference, not officially assigned yet */ +#define ND_OPT_ROUTE_INFO 24 /* RFC 4191 */ +#define ND_OPT_RDNSS 25 /* RFC 6016 */ +#define ND_OPT_DNSSL 31 /* RFC 6016 */ struct nd_opt_prefix_info {/* prefix information */ u_int8_tnd_opt_pi_type; @@ -338,6 +339,22 @@ struct nd_opt_route_info { /* route info /* prefix follows */ } __packed; +struct nd_opt_rdnss { /* RDNSS option (RFC 6106) */ + u_int8_tnd_opt_rdnss_type; + u_int8_tnd_opt_rdnss_len; + u_int16_t nd_opt_rdnss_reserved; + u_int32_t nd_opt_rdnss_lifetime; + /* followed by list of recursive DNS servers */ +} __packed; + +struct nd_opt_dnssl { /* DNSSL option (RFC 6106) */ + u_int8_tnd_opt_dnssl_type; + u_int8_tnd_opt_dnssl_len; + u_int16_t nd_opt_dnssl_reserved; + u_int32_t nd_opt_dnssl_lifetime; + /* followed by list of DNS search domains */ +} __packed; + /* * icmp6 namelookup */ Modified: head/usr.sbin/rtadvd/Makefile == --- head/usr.sbin/rtadvd/Makefile Mon Jun 6 02:46:22 2011 (r222731) +++ head/usr.sbin/rtadvd/Makefile Mon Jun 6 03:06:43 2011 (r222732) @@ -23,6 +23,6 @@ LDADD=-lutil CFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_POLL_H -DROUTEINFO -WARNS?=1 +WARNS?=6 .include Modified: head/usr.sbin/rtadvd/advcap.c == --- head/usr.sbin/rtadvd/advcap.c Mon Jun 6 02:46:22 2011 (r222731) +++ head/usr.sbin/rtadvd/advcap.c Mon Jun 6 03:06:43 2011 (r222732) @@ -64,8 +64,6 @@ #define V_TERM "HOST" #endif -char *RM; - /* * termcap - routines for dealing with the terminal capability data base * @@ -83,12 +81,11 @@ char*RM; static char *tbuf; static int hopcount; /* detect infinite loops in termcap, init 0 */ -static char *remotefile; - -extern char *conffile; +static const char *remotefile; +extern const char *conffile; int tgetent(char *, char *); -int getent(char *, char *, char *); +int getent(char *, char *, const char *); int tnchktc(void); int tnamatch(char *); static char *tskip(char *); @@ -103,22 +100,18 @@ static char *tdecode(char *, char **); * we just notice escaped newlines. */ int -tgetent(bp, name) - char *bp, *name; +tgetent(char *bp, char *name) { - char *cp; - - remote
svn commit: r222733 - head/etc
Author: hrs Date: Mon Jun 6 03:37:33 2011 New Revision: 222733 URL: http://svn.freebsd.org/changeset/base/222733 Log: Remove "ifconfig IF inet6 -accept_rtadv" when ipv6_gateway_enable=YES because this is no longer needed. Modified: head/etc/network.subr Modified: head/etc/network.subr == --- head/etc/network.subr Mon Jun 6 03:06:43 2011(r222732) +++ head/etc/network.subr Mon Jun 6 03:37:33 2011(r222733) @@ -100,25 +100,19 @@ ifconfig_up() # inet6 specific if afexists inet6; then - if ipv6if $1; then - if checkyesno ipv6_gateway_enable; then - _ipv6_opts="-accept_rtadv" - fi + if checkyesno ipv6_activate_all_interfaces; then + _ipv6_opts="-ifdisabled" else - if checkyesno ipv6_activate_all_interfaces; then - _ipv6_opts="-ifdisabled" - else - _ipv6_opts="ifdisabled" - fi - - # backward compatibility: $ipv6_enable - case $ipv6_enable in - [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - _ipv6_opts="${_ipv6_opts} accept_rtadv" - ;; - esac + _ipv6_opts="ifdisabled" fi + # backward compatibility: $ipv6_enable + case $ipv6_enable in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + _ipv6_opts="${_ipv6_opts} accept_rtadv" + ;; + esac + if [ -n "${_ipv6_opts}" ]; then ifconfig $1 inet6 ${_ipv6_opts} fi ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r222734 - head/sys/netinet6
Author: hrs Date: Mon Jun 6 04:12:57 2011 New Revision: 222734 URL: http://svn.freebsd.org/changeset/base/222734 Log: Do not activate automatic LL addr configuration when 0/1->1 transition of ND6_IFF_IFDISABLED flag. Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c == --- head/sys/netinet6/nd6.c Mon Jun 6 03:37:33 2011(r222733) +++ head/sys/netinet6/nd6.c Mon Jun 6 04:12:57 2011(r222734) @@ -1327,6 +1327,7 @@ nd6_ioctl(u_long cmd, caddr_t data, stru * accept_rtadv or auto_linklocal. */ if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && + !(ND.flags & ND6_IFF_IFDISABLED) && (ND.flags & (ND6_IFF_ACCEPT_RTADV | ND6_IFF_AUTO_LINKLOCAL))) ND.flags &= ~ND6_IFF_IFDISABLED; @@ -1388,7 +1389,8 @@ nd6_ioctl(u_long cmd, caddr_t data, stru /* If no link-local address on ifp, configure */ ND_IFINFO(ifp)->flags |= ND6_IFF_AUTO_LINKLOCAL; in6_ifattach(ifp, NULL); - } else if (ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) { + } else if ((ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) && + !(ND.flags & ND6_IFF_IFDISABLED)) { /* * When the IF already has * ND6_IFF_AUTO_LINKLOCAL and no link-local ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r222743 - head/usr.sbin/rtadvd
Author: hrs Date: Mon Jun 6 10:51:00 2011 New Revision: 222743 URL: http://svn.freebsd.org/changeset/base/222743 Log: Fix build on 64-bit arch. Submitted by: dim Pointy hat to:hrs Modified: head/usr.sbin/rtadvd/config.c head/usr.sbin/rtadvd/dump.c head/usr.sbin/rtadvd/rtadvd.c Modified: head/usr.sbin/rtadvd/config.c == --- head/usr.sbin/rtadvd/config.c Mon Jun 6 10:39:38 2011 (r222742) +++ head/usr.sbin/rtadvd/config.c Mon Jun 6 10:51:00 2011 (r222743) @@ -109,7 +109,7 @@ dname_labelenc(char *dst, const char *sr /* Always need a 0-length label at the tail. */ *dst++ = '\0'; - syslog(LOG_DEBUG, "<%s> labellen = %d", __func__, dst - dst_origin); + syslog(LOG_DEBUG, "<%s> labellen = %td", __func__, dst - dst_origin); return (dst - dst_origin); } Modified: head/usr.sbin/rtadvd/dump.c == --- head/usr.sbin/rtadvd/dump.c Mon Jun 6 10:39:38 2011(r222742) +++ head/usr.sbin/rtadvd/dump.c Mon Jun 6 10:51:00 2011(r222743) @@ -310,7 +310,7 @@ dname_labeldec(char *dst, size_t dlen, c (src + len) <= src_last) { if (dst != dst_origin) *dst++ = '.'; - syslog(LOG_DEBUG, "<%s> labellen = %d", __func__, len); + syslog(LOG_DEBUG, "<%s> labellen = %zd", __func__, len); memcpy(dst, src, len); src += len; dst += len; Modified: head/usr.sbin/rtadvd/rtadvd.c == --- head/usr.sbin/rtadvd/rtadvd.c Mon Jun 6 10:39:38 2011 (r222742) +++ head/usr.sbin/rtadvd/rtadvd.c Mon Jun 6 10:51:00 2011 (r222743) @@ -789,7 +789,7 @@ rtadvd_input(void) #else if ((size_t)i < sizeof(struct icmp6_hdr)) { syslog(LOG_ERR, - "<%s> packet size(%d) is too short", + "<%s> packet size(%zd) is too short", __func__, i); return; } @@ -827,7 +827,7 @@ rtadvd_input(void) if ((size_t)i < sizeof(struct nd_router_solicit)) { syslog(LOG_NOTICE, "<%s> RS from %s on %s does not have enough " - "length (len = %d)", + "length (len = %zd)", __func__, inet_ntop(AF_INET6, &rcvfrom.sin6_addr, ntopbuf, sizeof(ntopbuf)), @@ -873,7 +873,7 @@ rtadvd_input(void) if ((size_t)i < sizeof(struct nd_router_advert)) { syslog(LOG_NOTICE, "<%s> RA from %s on %s does not have enough " - "length (len = %d)", + "length (len = %zd)", __func__, inet_ntop(AF_INET6, &rcvfrom.sin6_addr, ntopbuf, sizeof(ntopbuf)), ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r222732 - in head: sys/netinet usr.sbin/rtadvd usr.sbin/rtsold
Dimitry Andric wrote in <4dec9ec1.9070...@freebsd.org>: di> > Modified: head/usr.sbin/rtadvd/Makefile di> > == di> > --- head/usr.sbin/rtadvd/Makefile Mon Jun 6 02:46:22 2011 (r222731) di> > +++ head/usr.sbin/rtadvd/Makefile Mon Jun 6 03:06:43 2011 (r222732) di> > @@ -23,6 +23,6 @@ LDADD= -lutil di> > di> > CFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_POLL_H -DROUTEINFO di> > di> > -WARNS?= 1 di> > +WARNS?= 6 di> di> Hi, di> di> This code is not yet WARNS=6 clean, at least not on amd64: Oh, thank you for pointing out. I overlooked that. Committed just now. -- Hiroki pgpA0HkswYb3S.pgp Description: PGP signature
svn commit: r222746 - head/etc
Author: hrs Date: Mon Jun 6 11:36:10 2011 New Revision: 222746 URL: http://svn.freebsd.org/changeset/base/222746 Log: Do not mark lo0 as IFDISABLED even if there is no $ifconfig_lo0_ipv6 line. Modified: head/etc/network.subr Modified: head/etc/network.subr == --- head/etc/network.subr Mon Jun 6 11:10:38 2011(r222745) +++ head/etc/network.subr Mon Jun 6 11:36:10 2011(r222746) @@ -102,7 +102,7 @@ ifconfig_up() if afexists inet6; then if checkyesno ipv6_activate_all_interfaces; then _ipv6_opts="-ifdisabled" - else + elif [ "$1" != "lo0" ]; then _ipv6_opts="ifdisabled" fi ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r222771 - head/usr.sbin/rtadvd
Author: hrs Date: Mon Jun 6 20:14:50 2011 New Revision: 222771 URL: http://svn.freebsd.org/changeset/base/222771 Log: Set WARNS=1 temporarily to unbreak universe. Modified: head/usr.sbin/rtadvd/Makefile Modified: head/usr.sbin/rtadvd/Makefile == --- head/usr.sbin/rtadvd/Makefile Mon Jun 6 19:33:19 2011 (r222770) +++ head/usr.sbin/rtadvd/Makefile Mon Jun 6 20:14:50 2011 (r222771) @@ -23,6 +23,6 @@ LDADD=-lutil CFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_POLL_H -DROUTEINFO -WARNS?=6 +WARNS?=1 .include ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r222732 - in head: sys/netinet usr.sbin/rtadvd usr.sbin/rtsold
Warner Losh wrote in : im> im> On Jun 6, 2011, at 8:02 AM, Jaakko Heinonen wrote: im> im> > On 2011-06-06, Hiroki Sato wrote: im> >> di> > -WARNS?= 1 im> >> di> > +WARNS?= 6 im> > im> > Shouldn't you just remove the WARNS line because the default for im> > usr.sbin/ is 6? im> im> No, the change should be reverted, since it breaks ARM. Sorry, reverted it just now. -- Hiroki pgpNY8mnM6QB2.pgp Description: PGP signature
svn commit: r222820 - head/usr.sbin/rtadvd
Author: hrs Date: Tue Jun 7 12:00:29 2011 New Revision: 222820 URL: http://svn.freebsd.org/changeset/base/222820 Log: - Use ELM_MALLOC() for struct rainfo. - Fix a missing back pointer assignment in struct prefix to struct rainfo when addr="" is specified. This caused SIGSEGV. - Insert a prefix element to a tail queue after setting parameters. Modified: head/usr.sbin/rtadvd/config.c Modified: head/usr.sbin/rtadvd/config.c == --- head/usr.sbin/rtadvd/config.c Tue Jun 7 11:11:11 2011 (r222819) +++ head/usr.sbin/rtadvd/config.c Tue Jun 7 12:00:29 2011 (r222820) @@ -229,13 +229,7 @@ getconfig(int idx) __func__, intface); } - rai = malloc(sizeof(*rai)); - if (rai == NULL) { - syslog(LOG_INFO, "<%s> %s: can't allocate enough memory", - __func__, intface); - exit(1); - } - memset(rai, 0, sizeof(*rai)); + ELM_MALLOC(rai, exit(1)); TAILQ_INIT(&rai->rai_prefix); #ifdef ROUTEINFO TAILQ_INIT(&rai->rai_route); @@ -394,10 +388,7 @@ getconfig(int idx) /* allocate memory to store prefix information */ ELM_MALLOC(pfx, exit(1)); - - /* link into chain */ - TAILQ_INSERT_TAIL(&rai->rai_prefix, pfx, pfx_next); - rai->rai_pfxs++; + pfx->pfx_rainfo = rai; pfx->pfx_origin = PREFIX_FROM_CONFIG; if (inet_pton(AF_INET6, addr, &pfx->pfx_prefix) != 1) { @@ -481,6 +472,9 @@ getconfig(int idx) pfx->pfx_pltimeexpire = now.tv_sec + pfx->pfx_preflifetime; } + /* link into chain */ + TAILQ_INSERT_TAIL(&rai->rai_prefix, pfx, pfx_next); + rai->rai_pfxs++; } if (rai->rai_advifprefix && rai->rai_pfxs == 0) get_prefix(rai); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r222824 - head/usr.sbin/rtadvd
Author: hrs Date: Tue Jun 7 15:40:17 2011 New Revision: 222824 URL: http://svn.freebsd.org/changeset/base/222824 Log: Fix a bug that prevents tc=xxx from working. Modified: head/usr.sbin/rtadvd/advcap.c Modified: head/usr.sbin/rtadvd/advcap.c == --- head/usr.sbin/rtadvd/advcap.c Tue Jun 7 14:36:13 2011 (r222823) +++ head/usr.sbin/rtadvd/advcap.c Tue Jun 7 15:40:17 2011 (r222824) @@ -81,7 +81,6 @@ static char *tbuf; static int hopcount; /* detect infinite loops in termcap, init 0 */ -static const char *remotefile; extern const char *conffile; int tgetent(char *, char *); @@ -204,7 +203,7 @@ tnchktc(void) write(STDERR_FILENO, "Infinite tc= loop\n", 18); return (0); } - if (getent(tcbuf, tcname, remotefile) != 1) { + if (getent(tcbuf, tcname, conffile) != 1) { return (0); } for (q = tcbuf; *q++ != ':'; ) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r222848 - head/usr.sbin/rtsold
Author: hrs Date: Wed Jun 8 04:06:56 2011 New Revision: 222848 URL: http://svn.freebsd.org/changeset/base/222848 Log: - Disable "resolvconf -d" temporarily to avoid extra invocations of the script under a certain condition. - Fix argv handling. Spotted by: ume Modified: head/usr.sbin/rtsold/rtsol.c head/usr.sbin/rtsold/rtsold.c Modified: head/usr.sbin/rtsold/rtsol.c == --- head/usr.sbin/rtsold/rtsol.cWed Jun 8 03:55:58 2011 (r222847) +++ head/usr.sbin/rtsold/rtsol.cWed Jun 8 04:06:56 2011 (r222848) @@ -625,8 +625,10 @@ free1: if (!TAILQ_EMPTY(&sm_rdnss_head)) CALL_SCRIPT(RESADD, &sm_rdnss_head); +#if 0 else CALL_SCRIPT(RESDEL, NULL); +#endif ra_opt_handler_freeit: /* Clear script message queue. */ Modified: head/usr.sbin/rtsold/rtsold.c == --- head/usr.sbin/rtsold/rtsold.c Wed Jun 8 03:55:58 2011 (r222847) +++ head/usr.sbin/rtsold/rtsold.c Wed Jun 8 04:06:56 2011 (r222848) @@ -124,6 +124,7 @@ main(int argc, char **argv) int maxfd; #endif int rtsock; + char *argv0; #ifndef SMALL /* rtsold */ @@ -134,6 +135,8 @@ main(int argc, char **argv) fflag = 1; once = 1; #endif + argv0 = argv[0]; + while ((ch = getopt(argc, argv, opts)) != -1) { switch (ch) { case 'a': @@ -185,9 +188,9 @@ main(int argc, char **argv) if (!fflag) { char *ident; - ident = strrchr(argv[0], '/'); + ident = strrchr(argv0, '/'); if (!ident) - ident = argv[0]; + ident = argv0; else ident++; openlog(ident, LOG_NDELAY|LOG_PID, LOG_DAEMON); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r222861 - head/usr.sbin/rtsold
Author: hrs Date: Wed Jun 8 16:03:29 2011 New Revision: 222861 URL: http://svn.freebsd.org/changeset/base/222861 Log: - Accumulate RA options instead of replacing old ones when a new RA arrived. RFC 4861 6.3.4 clearly defines handling multiple RAs in this way. - RDNSS/DNSSL options from multiple RAs on a single link will be gathered and sent to resolvconf(8). - Call "resolvconf -d" only after at least one RDNSS or DNSSL option is received and then all of them are expired. - The rtsold.dump output now supports displaying a list of the RA options. - Use more human-readable expression for logging values of struct timeval. Discussed with: ume Modified: head/usr.sbin/rtsold/dump.c head/usr.sbin/rtsold/rtsol.c head/usr.sbin/rtsold/rtsold.c head/usr.sbin/rtsold/rtsold.h Modified: head/usr.sbin/rtsold/dump.c == --- head/usr.sbin/rtsold/dump.c Wed Jun 8 16:00:30 2011(r222860) +++ head/usr.sbin/rtsold/dump.c Wed Jun 8 16:03:29 2011(r222861) @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -53,14 +54,16 @@ static FILE *fp; extern struct ifinfo *iflist; static void dump_interface_status(void); -static const char *sec2str(time_t); static const char * const ifstatstr[] = {"IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE"}; static void dump_interface_status(void) { struct ifinfo *ifi; + struct rainfo *rai; + struct ra_opt *rao; struct timeval now; + char ntopbuf[INET6_ADDRSTRLEN]; gettimeofday(&now, NULL); @@ -91,9 +94,33 @@ dump_interface_status(void) (int)ifi->timer.tv_sec, (int)ifi->timer.tv_usec, (ifi->expire.tv_sec < now.tv_sec) ? "expired" - : sec2str(ifi->expire.tv_sec - now.tv_sec)); + : sec2str(&ifi->expire)); } fprintf(fp, " number of valid RAs: %d\n", ifi->racnt); + + TAILQ_FOREACH(rai, &ifi->ifi_rainfo, rai_next) { + fprintf(fp, " RA from %s\n", + inet_ntop(AF_INET6, &rai->rai_saddr.sin6_addr, + ntopbuf, sizeof(ntopbuf))); + TAILQ_FOREACH(rao, &rai->rai_ra_opt, rao_next) { + fprintf(fp, "option: "); + switch (rao->rao_type) { + case ND_OPT_RDNSS: + fprintf(fp, "RDNSS: %s (expire: %s)\n", + (char *)rao->rao_msg, + sec2str(&rao->rao_expire)); + break; + case ND_OPT_DNSSL: + fprintf(fp, "DNSSL: %s (expire: %s)\n", + (char *)rao->rao_msg, + sec2str(&rao->rao_expire)); + break; + default: + break; + } + } + fprintf(fp, "\n"); + } } } @@ -109,8 +136,8 @@ rtsold_dump_file(const char *dumpfile) fclose(fp); } -static const char * -sec2str(time_t total) +const char * +sec2str(const struct timeval *total) { static char result[256]; int days, hours, mins, secs; @@ -118,11 +145,19 @@ sec2str(time_t total) char *p = result; char *ep = &result[sizeof(result)]; int n; + struct timeval now; + time_t tsec; - days = total / 3600 / 24; - hours = (total / 3600) % 24; - mins = (total / 60) % 60; - secs = total % 60; + gettimeofday(&now, NULL); + tsec = total->tv_sec; + tsec += total->tv_usec / 100; + tsec -= now.tv_sec; + tsec -= now.tv_usec / 100; + + days = tsec / 3600 / 24; + hours = (tsec / 3600) % 24; + mins = (tsec / 60) % 60; + secs = tsec % 60; if (days) { first = 0; Modified: head/usr.sbin/rtsold/rtsol.c == --- head/usr.sbin/rtsold/rtsol.cWed Jun 8 16:00:30 2011 (r222860) +++ head/usr.sbin/rtsold/rtsol.cWed Jun 8 16:03:29 2011 (r222861) @@ -85,6 +85,7 @@ static const struct sockaddr_in6 sin6_al static void call_script(const int, const char *const *, void *); static size_t dname_labeldec(char *, size_t, const char *); static int safefile(const char *); +static struct ra_opt *find_raopt(struct rainfo *, int, void *, size_t); #define_ARGS_OTHER otherconf_script, ifi->ifname #define_ARGS_RESADD
Re: svn commit: r222883 - head/sbin/rtsol
"Kenneth D. Merry" wrote in <201106082159.p58lx74l049...@svn.freebsd.org>: ke> Author: ken ke> Date: Wed Jun 8 21:59:07 2011 ke> New Revision: 222883 ke> URL: http://svn.freebsd.org/changeset/base/222883 ke> ke> Log: ke> Add dump.c to the rtsol build. It is needed now that sec2str is non-static ke> and used in rtsold.c. Thank you for fixing! I forgot to commit changes in the different directory... I'll be careful. -- Hiroki pgpKpkIrCEq2q.pgp Description: PGP signature
svn commit: r222972 - head/usr.sbin/rtadvd
Author: hrs Date: Sat Jun 11 03:25:10 2011 New Revision: 222972 URL: http://svn.freebsd.org/changeset/base/222972 Log: Support SIGHUP for reloading /etc/rtadvd.conf. Modified: head/usr.sbin/rtadvd/config.c head/usr.sbin/rtadvd/config.h head/usr.sbin/rtadvd/rtadvd.8 head/usr.sbin/rtadvd/rtadvd.c head/usr.sbin/rtadvd/rtadvd.h Modified: head/usr.sbin/rtadvd/config.c == --- head/usr.sbin/rtadvd/config.c Sat Jun 11 02:22:11 2011 (r222971) +++ head/usr.sbin/rtadvd/config.c Sat Jun 11 03:25:10 2011 (r222972) @@ -142,6 +142,33 @@ dname_labelenc(char *dst, const char *sr } while(0) int +loadconfig(char *ifl_names[], const int ifl_len) +{ + int i; + int idx; + int error; + + for (i = 0; i < ifl_len; i++) { + idx = if_nametoindex(ifl_names[i]); + if (idx == 0) { + syslog(LOG_ERR, + "<%s> interface %s not found. " + "Ignored at this moment.", __func__, ifl_names[i]); + continue; + } + syslog(LOG_INFO, + "<%s> loading config for %s.", __func__, ifl_names[i]); + error = getconfig(idx); + if (error) + syslog(LOG_ERR, + "<%s> invalid configuration for %s. " + "Ignored at this moment.", __func__, ifl_names[i]); + } + + return (0); +} + +int rmconfig(int idx) { struct rainfo *rai; @@ -207,6 +234,7 @@ getconfig(int idx) int stat, i; char tbuf[BUFSIZ]; struct rainfo *rai; + struct rainfo *rai_old; long val; int64_t val64; char buf[BUFSIZ]; @@ -220,6 +248,10 @@ getconfig(int idx) return (-1); } + TAILQ_FOREACH(rai_old, &railist, rai_next) + if (idx == rai_old->rai_ifindex) + break; + if ((stat = agetent(tbuf, intface)) <= 0) { memset(tbuf, 0, sizeof(tbuf)); syslog(LOG_INFO, @@ -254,7 +286,7 @@ getconfig(int idx) syslog(LOG_ERR, "<%s> can't get information of %s", __func__, intface); - return (-1); + goto getconfig_free_rai; } rai->rai_ifindex = rai->rai_sdl->sdl_index; } else @@ -280,7 +312,7 @@ getconfig(int idx) "<%s> maxinterval (%ld) on %s is invalid " "(must be between %u and %u)", __func__, val, intface, MIN_MAXINTERVAL, MAX_MAXINTERVAL); - return (-1); + goto getconfig_free_rai; } rai->rai_maxinterval = (u_int)val; @@ -292,7 +324,7 @@ getconfig(int idx) "(must be between %d and %d)", __func__, val, intface, MIN_MININTERVAL, (rai->rai_maxinterval * 3) / 4); - return (-1); + goto getconfig_free_rai; } rai->rai_mininterval = (u_int)val; @@ -311,7 +343,7 @@ getconfig(int idx) if ((val & ND_RA_FLAG_RTPREF_HIGH)) { syslog(LOG_ERR, "<%s> the \'h\' and \'l\'" " router flags are exclusive", __func__); - return (-1); + goto getconfig_free_rai; } val |= ND_RA_FLAG_RTPREF_LOW; } @@ -328,7 +360,7 @@ getconfig(int idx) if (rai->rai_rtpref == ND_RA_FLAG_RTPREF_RSV) { syslog(LOG_ERR, "<%s> invalid router preference (%02x) on %s", __func__, rai->rai_rtpref, intface); - return (-1); + goto getconfig_free_rai; } MAYHAVE(val, "rltime", rai->rai_maxinterval * 3); @@ -339,7 +371,7 @@ getconfig(int idx) "(must be 0 or between %d and %d)", __func__, val, intface, rai->rai_maxinterval, MAXROUTERLIFETIME); - return (-1); + goto getconfig_free_rai; } rai->rai_lifetime = val & 0x; @@ -349,7 +381,7 @@ getconfig(int idx) "<%s> reachable time (%ld) on %s is invalid " "(must be no greater than %d)", __func__, val, intface, MAXREACHABLETIME); - return (-1); + goto getconfig_free_rai; } rai->rai_reachabletime = (u_int32_t)val; @@ -357,7 +389,7 @@ getconfig(int idx) if (val64 < 0 || val64 > 0x) { syslog(LOG_ERR, "<%s> retrans time (%lld) on %s out of range", __func__, (long long)val64, intface); - return (-1)
svn commit: r222996 - head/etc
Author: hrs Date: Sat Jun 11 21:40:37 2011 New Revision: 222996 URL: http://svn.freebsd.org/changeset/base/222996 Log: Add a helper function to check kern.features.* sysctls. Discussed with: dougb Modified: head/etc/network.subr head/etc/rc.subr Modified: head/etc/network.subr == --- head/etc/network.subr Sat Jun 11 21:27:14 2011(r222995) +++ head/etc/network.subr Sat Jun 11 21:40:37 2011(r222996) @@ -349,11 +349,8 @@ afexists() _af=$1 case ${_af} in - inet) - ${SYSCTL_N} kern.features.inet > /dev/null 2>&1 - ;; - inet6) - ${SYSCTL_N} kern.features.inet6 > /dev/null 2>&1 + inet|inet6) + check_kern_features ${_af} ;; ipx) ${SYSCTL_N} net.ipx > /dev/null 2>&1 Modified: head/etc/rc.subr == --- head/etc/rc.subrSat Jun 11 21:27:14 2011(r222995) +++ head/etc/rc.subrSat Jun 11 21:40:37 2011(r222996) @@ -1734,6 +1734,28 @@ check_required_after() fi +# check_kern_features mib +# Return existence of kern.features.* sysctl MIB as true or +# false. The result will be cached in $_rc_cache_kern_features_ +# namespace. "0" means the kern.features.X exists. + +check_kern_features() +{ + local _v + + [ -n "$1" ] || return 1; + _v=`eval echo "\\$_rc_cache_kern_features_$1"` + [ -n "$_v" ] && return "$_v"; + + if ${SYSCTL_N} kern.features.$1 > /dev/null 2>&1; then + eval _rc_cache_kern_features_$1=0 + return 0 + else + eval _rc_cache_kern_features_$1=1 + return 1 + fi +} + # _echoonce var msg mode # mode=0: Echo $msg if ${$var} is empty. # After doing echo, a string is set to ${$var}. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r222997 - head/etc/rc.d
Author: hrs Date: Sat Jun 11 21:41:44 2011 New Revision: 222997 URL: http://svn.freebsd.org/changeset/base/222997 Log: - Remove $ipv6_gateway_enable check. - Use list_net_interfaces() instead of "ifconfig -l". Modified: head/etc/rc.d/rtadvd Modified: head/etc/rc.d/rtadvd == --- head/etc/rc.d/rtadvdSat Jun 11 21:40:37 2011(r222996) +++ head/etc/rc.d/rtadvdSat Jun 11 21:41:44 2011(r222997) @@ -18,12 +18,6 @@ start_precmd="rtadvd_precmd" rtadvd_precmd() { - if ! checkyesno ipv6_gateway_enable ; then - warn \ - "${name} cannot be used on IPv6 host, only on an IPv6 router." - return 1 - fi - # This should be enabled with a great care. # You may want to fine-tune /etc/rtadvd.conf. # @@ -42,7 +36,7 @@ rtadvd_precmd() # case ${rtadvd_interfaces} in [Aa][Uu][Tt][Oo]|'') - for i in `ifconfig -l` ; do + for i in `list_net_interfaces`; do case $i in lo0)continue ;; esac ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r223457 - head/release/doc/en_US.ISO8859-1/readme
Author: hrs Date: Thu Jun 23 02:35:55 2011 New Revision: 223457 URL: http://svn.freebsd.org/changeset/base/223457 Log: Remove links to mirrorlist.FreeBSD.org. Submitted by: ryusuke Reported by: gavin, brucec Modified: head/release/doc/en_US.ISO8859-1/readme/article.sgml Modified: head/release/doc/en_US.ISO8859-1/readme/article.sgml == --- head/release/doc/en_US.ISO8859-1/readme/article.sgmlThu Jun 23 00:36:49 2011(r223456) +++ head/release/doc/en_US.ISO8859-1/readme/article.sgmlThu Jun 23 02:35:55 2011(r223457) @@ -184,8 +184,7 @@ Lists of locations that mirror &os; can be found in the FTP - Sites section of the Handbook, or on the http://mirrorlist.FreeBSD.org/";> Web pages. + Sites section of the Handbook. Finding a close (in networking terms) mirror from which to download the distribution is highly recommended. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r223458 - head/release/doc/share/sgml
Author: hrs Date: Thu Jun 23 02:38:06 2011 New Revision: 223458 URL: http://svn.freebsd.org/changeset/base/223458 Log: Bump &release.manpath.*;. Modified: head/release/doc/share/sgml/release.ent Modified: head/release/doc/share/sgml/release.ent == --- head/release/doc/share/sgml/release.ent Thu Jun 23 02:35:55 2011 (r223457) +++ head/release/doc/share/sgml/release.ent Thu Jun 23 02:38:06 2011 (r223458) @@ -36,8 +36,8 @@ http://www.FreeBSD.org/cgi/man.cgi";> - - + + ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r223752 - head/usr.sbin/rtadvd
Author: hrs Date: Mon Jul 4 03:19:06 2011 New Revision: 223752 URL: http://svn.freebsd.org/changeset/base/223752 Log: Add sanity check for ifm_version in struct if_msghdr. Modified: head/usr.sbin/rtadvd/if.c Modified: head/usr.sbin/rtadvd/if.c == --- head/usr.sbin/rtadvd/if.c Mon Jul 4 01:27:41 2011(r223751) +++ head/usr.sbin/rtadvd/if.c Mon Jul 4 03:19:06 2011(r223752) @@ -105,6 +105,12 @@ if_nametosdl(char *name) lim = buf + len; for (next = buf; next < lim; next += ifm->ifm_msglen) { ifm = (struct if_msghdr *)next; + if (ifm->ifm_version != RTM_VERSION) { + syslog(LOG_ERR, + "<%s> RTM_VERSION mismatch (%d != %d).", + __func__, ifm->ifm_version, RTM_VERSION); + continue; + } if (ifm->ifm_type == RTM_IFINFO) { sa = (struct sockaddr *)(ifm + 1); get_rtaddrs(ifm->ifm_addrs, sa, rti_info); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r224144 - in head/usr.sbin: . rtadvctl rtadvd
once, the +Increase verbosity level. +When specified once, the .Nm -utility shows additional information on prefixes, RDNSS, and DNSSL +utility shows additional information about prefixes, RDNSS, and DNSSL options. -When twice, it shows information on inactive interfaces and -some statistics. +When given twice, it additionally shows information about +inactive interfaces and some statistics. .El .Pp The subcommands are as follows: .Bl -tag -width indent .\" -.It reload -Specifies reloading the configuration file. +.It reload Op interfaces... +Specifies to reload the configuration file. If one or more +.Ar interface +is specified, configuration entries for the interfaces will be reloaded +selectively. +.It enable interfaces... +Specifies to mark the interface as enable and to try to reload the +configuration entry. +This subcommand is useful for dynamically-added interfaces. +.Pp +The +.Xr rtadvd 8 +daemon marks an interface as enable if the interface exists and the +configuration file has a valid entry for that when it is invoked. +.It disable interfaces... +Specifies to mark the interface as disable. .It shutdown -Makes +Makes the +.Xr rtadvd 8 +daemon shut down. +Note that the .Xr rtadvd 8 -daemon shut down immediately. +daemon will send several RAs with zero lifetime to invalidate the old +information on each interface. +It will take at most nine seconds. .It show Op interfaces... Displays information on Router Advertisement messages being sent -on each interfaces. +on each interface. .Sh SEE ALSO -.Xr rtadv 8 , +.Xr rtadvd 8 , .Xr rtadvd.conf 5 .Sh HISTORY The .Nm command first appeared in .Fx 9.0 . -.Sh BUGS -The -.Xr rtadvd 8 -daemon stops responding to -.Nm -for a while just after reloading the configuration file by the reload -subcommand. -This is because in the current implementation it cannot communicate -with +.Sh AUTHORS .Nm -during sending some additional RAs for graceful transition from one -configuration to another. -It will take at most nine seconds for each interface. +was written by +.An "Hiroki Sato" Aq h...@freebsd.org . Modified: head/usr.sbin/rtadvctl/rtadvctl.c == --- user/hrs/ipv6/usr.sbin/rtadvctl/rtadvctl.c Thu Jul 14 10:09:58 2011 (r224006) +++ head/usr.sbin/rtadvctl/rtadvctl.c Sun Jul 17 19:24:54 2011 (r224144) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,7 @@ #include "rtadvd.h" #include "if.h" #include "timer_subr.h" +#include "timer.h" #include "control.h" #include "control_client.h" @@ -84,9 +86,7 @@ static intaction_shutdown(int, char **) static int action_show(int, char **); static int action_show_prefix(struct prefix *); -#ifdef ROUTEINFO static int action_show_rtinfo(struct rtinfo *); -#endif static int action_show_rdnss(void *); static int action_show_dnssl(void *); @@ -108,14 +108,17 @@ static struct dispatch_table { { "show", action_show }, { "reload", action_reload }, { "shutdown", action_shutdown }, - { NULL, NULL }, { "enable", action_enable }, { "disable", action_disable }, + { NULL, NULL }, { "echo", action_echo }, { "version", action_version }, { NULL, NULL }, }; +static char errmsgbuf[1024]; +static char *errmsg = NULL; + static void mysyslog(int priority, const char * restrict fmt, ...) { @@ -177,13 +180,17 @@ main(int argc, char *argv[]) } } - if (action != NULL) { - error = (dtable[i].dt_act)(--argc, ++argv); - if (error) - fprintf(stderr, "%s failed.\n", dtable[i].dt_comm); - } else + if (action == NULL) usage(); + error = (dtable[i].dt_act)(--argc, ++argv); + if (error) { + fprintf(stderr, "%s failed", dtable[i].dt_comm); + if (errmsg != NULL) + fprintf(stderr, ": %s", errmsg); + fprintf(stderr, ".\n"); + } + return (error); } @@ -295,33 +302,69 @@ action_propset(char *argv) return (action_plgeneric(CM_TYPE_REQ_SET_PROP, argv, buf)); } -/* XXX */ static int -action_enable(int argc, char **argv) +action_disable(int argc, char **argv) { - argc = argc; - argv = argv; + char *action_argv; + char argv_disable[IFNAMSIZ + sizeof(":disable=")]; + int i; + int error; - return (0); + if (argc < 1) + return (1); + + error = 0; + for (i = 0; i < argc; i++) { + sprintf(argv_disable, "%s:disable=", argv[i]); + action_argv = argv_disable; + error
Re: svn commit: r211023 - head/usr.sbin/syslogd
Oliver Fromme wrote in <201008101623.o7agns7i042...@haluter.fromme.com>: ol> -static int validate(struct sockaddr *, const char *); ol> -static voidunmapped(struct sockaddr *); ol> +static int validate(struct sockaddr_storage *, const char *); ol> +static voidunmapped(struct sockaddr_storage *); Why is s/struct sockaddr */struct sockaddr_storage */ needed here? Using (struct sockaddr *) as an argument looks reasonable to me since the struct sockaddr_storage is mostly for memory allocation, not for access via pointer. -- Hiroki pgpFdWpTBa12r.pgp Description: PGP signature
svn commit: r212574 - in head: etc etc/defaults etc/rc.d share/man/man5
Author: hrs Date: Mon Sep 13 19:51:15 2010 New Revision: 212574 URL: http://svn.freebsd.org/changeset/base/212574 Log: Revert changes in r206408. Discussed with: dougb, core.5, and core.6 Modified: head/etc/defaults/rc.conf head/etc/network.subr head/etc/rc.d/ip6addrctl head/etc/rc.d/netif head/etc/rc.d/netoptions head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf == --- head/etc/defaults/rc.conf Mon Sep 13 19:47:09 2010(r212573) +++ head/etc/defaults/rc.conf Mon Sep 13 19:51:15 2010(r212574) @@ -210,8 +210,6 @@ cloned_interfaces=""# List of cloned n ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0x" # Sample alias entry. #ifconfig_ed0_ipx="ipx 0x00010010" # Sample IPX address family entry. -#ifconfig_ed0_ipv6="RTADV" # Sample IPv6 entry for RA/rtsol(8) -#ifconfig_ed0_ipv6="inet6 auto_linklocal" # To configure only link-local #ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry #ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias #ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. @@ -446,9 +444,8 @@ ubthidhci_enable="NO" # Switch an USB B icmp_bmcastecho="NO" # respond to broadcast ping packets ### IPv6 options: ### -ipv6_network_interfaces="AUTO" # List of IPv6 network interfaces -ipv6_prefer="YES" # Use IPv6 when both IPv4 and IPv6 can be used -ipv6_privacy="NO" # Use privacy addresses with RTADV (RFC 4193) +ipv6_network_interfaces="none" # List of IPv6 network interfaces + # (or "auto" or "none"). ipv6_defaultrouter="NO"# Set to IPv6 default gateway (or NO). #ipv6_defaultrouter="2002:c058:6301::" # Use this for 6to4 (RFC 3068) ipv6_static_routes="" # Set to static route list (or leave empty). @@ -507,6 +504,7 @@ ipv6_ipfilter_rules="/etc/ipf6.rules" # # for examples ip6addrctl_enable="YES"# Set to YES to enable default address selection ip6addrctl_verbose="NO"# Set to YES to enable verbose configuration messages +ipv6_prefer="NO" # Use IPv6 when both IPv4 and IPv6 can be used ## ### System console options # Modified: head/etc/network.subr == --- head/etc/network.subr Mon Sep 13 19:47:09 2010(r212573) +++ head/etc/network.subr Mon Sep 13 19:51:15 2010(r212574) @@ -96,32 +96,44 @@ ifconfig_up() # inet6 specific if afexists inet6; then if ipv6if $1; then - # Implicitly handles ipv6_gateway_enable - _ipv6_opts='-ifdisabled -accept_rtadv' - - if ipv6_autoconfif $1; then - _ipv6_opts='-ifdisabled accept_rtadv' - fi - - ifconfig $1 inet6 $_ipv6_opts - - # ifconfig_IF_ipv6 - ifconfig_args=`ifconfig_getargs $1 ipv6` - - if [ -n "$ifconfig_args" ]; then - ifconfig $1 $ifconfig_args - _cfg=0 + if checkyesno ipv6_gateway_enable; then + _ipv6_opts="-accept_rtadv" fi else - # Remove in FreeBSD 10.x - # Explicit test is necessary here to avoid nonexistence error - case "$ipv6_enable" in - [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - warn "Interface $1 will NOT be configured for IPv6" + if checkyesno ipv6_prefer; then + _ipv6_opts="-ifdisabled" + else + _ipv6_opts="ifdisabled" + fi + + # backward compatibility: $ipv6_enable + case $ipv6_enable in + [Yy][Ee][Ss]) + _ipv6_opts="${_ipv6_opts} accept_rtadv" ;; esac + fi - ifconfig $1 inet6 ifdisabled + if [ -n "${_ipv6_opts}" ]; then + ifconfig $1 inet6 ${_ipv6_opts} + fi + + # ifconfig_IF_ipv6 + ifconfig_args=`ifconfig_getargs $1 ipv6` + if [ -n "${ifconfig_args}" ]; then + ifconfig $1 inet6 -ifdisabled + ifconfig $1 ${ifconfig_args} + _cfg=
svn commit: r212575 - in head/etc: . defaults
Author: hrs Date: Mon Sep 13 19:52:04 2010 New Revision: 212575 URL: http://svn.freebsd.org/changeset/base/212575 Log: Fix $ipv6_network_interfaces and set it as AUTO by default. Based on: changes in r206408 by dougb Modified: head/etc/defaults/rc.conf head/etc/network.subr Modified: head/etc/defaults/rc.conf == --- head/etc/defaults/rc.conf Mon Sep 13 19:51:15 2010(r212574) +++ head/etc/defaults/rc.conf Mon Sep 13 19:52:04 2010(r212575) @@ -444,7 +444,7 @@ ubthidhci_enable="NO" # Switch an USB B icmp_bmcastecho="NO" # respond to broadcast ping packets ### IPv6 options: ### -ipv6_network_interfaces="none" # List of IPv6 network interfaces +ipv6_network_interfaces="auto" # List of IPv6 network interfaces # (or "auto" or "none"). ipv6_defaultrouter="NO"# Set to IPv6 default gateway (or NO). #ipv6_defaultrouter="2002:c058:6301::" # Use this for 6to4 (RFC 3068) Modified: head/etc/network.subr == --- head/etc/network.subr Mon Sep 13 19:51:15 2010(r212574) +++ head/etc/network.subr Mon Sep 13 19:52:04 2010(r212575) @@ -417,32 +417,21 @@ ipv6if() ;; esac - # True if $ifconfig_IF_ipv6 is defined. - _tmpargs=`_ifconfig_getargs $_if ipv6` - if [ -n "${_tmpargs}" ]; then - return 0 - fi - - # backward compatibility: True if $ipv6_ifconfig_IF is defined. - _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` - if [ -n "${_tmpargs}" ]; then - return 0 - fi - case "${ipv6_network_interfaces}" in - [Aa][Uu][Tt][Oo]) - return 0 - ;; - ''|[Nn][Oo][Nn][Ee]) - return 1 - ;; - esac + $_if|"$_if "*|*" $_if"|*" $_if "*|[Aa][Uu][Tt][Oo]) + # True if $ifconfig_IF_ipv6 is defined. + _tmpargs=`_ifconfig_getargs $_if ipv6` + if [ -n "${_tmpargs}" ]; then + return 0 + fi - for i in ${ipv6_network_interfaces}; do - if [ "$i" = "$_if" ]; then + # backward compatibility: True if $ipv6_ifconfig_IF is defined. + _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` + if [ -n "${_tmpargs}" ]; then return 0 fi - done + ;; + esac return 1 } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r212576 - in head: etc/defaults etc/rc.d share/man/man5
Author: hrs Date: Mon Sep 13 19:52:46 2010 New Revision: 212576 URL: http://svn.freebsd.org/changeset/base/212576 Log: Add $ipv6_privacy to support net.inet6.ip6.use_tempaddr. Note that this will be replaced with a per-IF version later. Based on: changes in r206408 by dougb Modified: head/etc/defaults/rc.conf head/etc/rc.d/netoptions head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf == --- head/etc/defaults/rc.conf Mon Sep 13 19:52:04 2010(r212575) +++ head/etc/defaults/rc.conf Mon Sep 13 19:52:46 2010(r212576) @@ -453,6 +453,8 @@ ipv6_static_routes="" # Set to static r # route toward loopback interface. #ipv6_route_xxx="fec0:::0006:: -prefixlen 64 ::1" ipv6_gateway_enable="NO" # Set to YES if this host will be a gateway. +ipv6_privacy="NO" # Use privacy address on RA-receiving IFs + # (RFC 4193) route6d_enable="NO"# Set to YES to enable an IPv6 routing daemon. route6d_program="/usr/sbin/route6d"# Name of IPv6 routing daemon. Modified: head/etc/rc.d/netoptions == --- head/etc/rc.d/netoptionsMon Sep 13 19:52:04 2010(r212575) +++ head/etc/rc.d/netoptionsMon Sep 13 19:52:46 2010(r212576) @@ -99,6 +99,13 @@ netoptions_inet6() else ${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null fi + + if checkyesno ipv6_privacy; then + netoptions_init + echo -n " IPv6 Privacy Addresses" + ${SYSCTL_W} net.inet6.ip6.use_tempaddr=1 >/dev/null + ${SYSCTL_W} net.inet6.ip6.prefer_tempaddr=1 >/dev/null + fi } load_rc_config $name Modified: head/share/man/man5/rc.conf.5 == --- head/share/man/man5/rc.conf.5 Mon Sep 13 19:52:04 2010 (r212575) +++ head/share/man/man5/rc.conf.5 Mon Sep 13 19:52:46 2010 (r212576) @@ -1304,6 +1304,12 @@ flag and keywords see .Xr ifconfig 8 . .Pp +.It Va ipv6_privacy +.Pq Vt bool +If the variable is +.Dq Li YES +privacy addresses will be generated for each IPv6 +interface as described in RFC 4193. .It Va ipv6_network_interfaces .Pq Vt str This is the IPv6 equivalent of ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r212577 - head/etc
Author: hrs Date: Mon Sep 13 19:53:22 2010 New Revision: 212577 URL: http://svn.freebsd.org/changeset/base/212577 Log: - Check some specific IFs first in ipv6_autoconfif(). - $ipv6_enable supports YES|TRUE|ON|1 as in checkyesno(). Based on: changes in r206408 by dougb Modified: head/etc/network.subr Modified: head/etc/network.subr == --- head/etc/network.subr Mon Sep 13 19:52:46 2010(r212576) +++ head/etc/network.subr Mon Sep 13 19:53:22 2010(r212577) @@ -108,7 +108,7 @@ ifconfig_up() # backward compatibility: $ipv6_enable case $ipv6_enable in - [Yy][Ee][Ss]) + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) _ipv6_opts="${_ipv6_opts} accept_rtadv" ;; esac @@ -385,6 +385,7 @@ noafif() an[0-9]*|\ ath[0-9]*|\ ipw[0-9]*|\ + ipfw[0-9]*|\ iwi[0-9]*|\ iwn[0-9]*|\ ral[0-9]*|\ @@ -444,12 +445,21 @@ ipv6_autoconfif() local _if _tmpargs _arg _if=$1 - if ! ipv6if $_if; then + case $_if in + lo0|\ + stf[0-9]*|\ + faith[0-9]*|\ + lp[0-9]*|\ + sl[0-9]*) return 1 - fi + ;; + esac if noafif $_if; then return 1 fi + if ! ipv6if $_if; then + return 1 + fi if checkyesno ipv6_gateway_enable; then return 1 fi @@ -457,24 +467,11 @@ ipv6_autoconfif() if [ -n "${_tmpargs}" ]; then return 1 fi - - case $_if in - lo0|\ - stf[0-9]*|\ - faith[0-9]*|\ - lp[0-9]*|\ - sl[0-9]*|\ - pflog[0-9]*|\ - pfsync[0-9]*) - return 1 - ;; - esac - # backward compatibility: $ipv6_enable case $ipv6_enable in - [Yy][Ee][Ss]) + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0 - ;; + ;; esac _tmpargs=`_ifconfig_getargs $_if ipv6` ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r212578 - head/etc
Author: hrs Date: Mon Sep 13 19:53:54 2010 New Revision: 212578 URL: http://svn.freebsd.org/changeset/base/212578 Log: Localize $_punct_c in get_if_var() and whitespace clean-ups. Based on: changes in r206408 by dougb Modified: head/etc/network.subr Modified: head/etc/network.subr == --- head/etc/network.subr Mon Sep 13 19:53:22 2010(r212577) +++ head/etc/network.subr Mon Sep 13 19:53:54 2010(r212578) @@ -194,7 +194,7 @@ ifconfig_down() # $default if given. get_if_var() { - local _if _punct _var _default prefix suffix + local _if _punct _punct_c _var _default prefix suffix if [ $# -ne 2 -a $# -ne 3 ]; then err 3 'USAGE: get_if_var name var [default]' @@ -505,7 +505,7 @@ ifexists() } # ipv4_up if -# add IPv4 addresses to the interface $if +# add IPv4 addresses to the interface $if ipv4_up() { local _if _ret @@ -615,14 +615,14 @@ ipv6_down() ipv4_addrs_common() { local _ret _if _action _cidr _cidr_addr - local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount + local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount _ret=1 _if=$1 _action=$2 - + # get ipv4-addresses cidr_addr=`get_if_var $_if ipv4_addrs_IF` - + for _cidr in ${cidr_addr}; do _ipaddr=${_cidr%%/*} _netmask="/"${_cidr##*/} @@ -635,7 +635,7 @@ ipv4_addrs_common() if [ "${_action}" = "-alias" ]; then _netmask="" fi - + _ipcount=${_iplow} while [ "${_ipcount}" -le "${_iphigh}" ]; do eval "ifconfig ${_if} ${_action} ${_ipnet}.${_ipcount}${_netmask}" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r212579 - in head: . etc etc/defaults etc/rc.d share/man/man5
Author: hrs Date: Mon Sep 13 19:55:40 2010 New Revision: 212579 URL: http://svn.freebsd.org/changeset/base/212579 Log: Split $ipv6_prefer into $ip6addrctl_policy and $ipv6_activate_all_interfaces. The $ip6addrctl_policy is a variable to choose a pre-defined address selection policy set by ip6addrctl(8). The keyword "ipv4_prefer" sets IPv4-preferred one described in Section 10.3, the keyword "ipv6_prefer" sets IPv6-preferred one in Section 2.1 in RFC 3484, respectively. When "AUTO" is specified, it attempts to read /etc/ip6addrctl.conf first. If it is found, it reads and installs it as a policy table. If not, either of the two pre-defined policy tables is chosen automatically according to $ipv6_activate_all_interfaces. When $ipv6_activate_all_interfaces=NO, interfaces which have no corresponding $ifconfig_IF_ipv6 is marked as IFDISABLED for security reason. The default values are ip6addrctl_policy=AUTO and ipv6_activate_all_interfaces=NO. Discussed with: ume and bz Modified: head/UPDATING head/etc/defaults/rc.conf head/etc/network.subr head/etc/rc.d/ip6addrctl head/etc/rc.d/netif head/share/man/man5/rc.conf.5 Modified: head/UPDATING == --- head/UPDATING Mon Sep 13 19:53:54 2010(r212578) +++ head/UPDATING Mon Sep 13 19:55:40 2010(r212579) @@ -23,6 +23,25 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. ln -s aj /etc/malloc.conf.) 20100913: + The $ipv6_prefer variable in rc.conf(5) has been split into + $ip6addrctl_policy and $ipv6_activate_all_interfaces. + + The $ip6addrctl_policy is a variable to choose a pre-defined + address selection policy set by ip6addrctl(8). A value + "ipv4_prefer", "ipv6_prefer" or "AUTO" can be specified. The + default is "AUTO". + + The $ipv6_activate_all_interfaces specifies whether IFDISABLED + flag (see an entry of 20090926) is set on an interface with no + corresponding $ifconfig_IF_ipv6 line. The default is "NO" for + security reason. If you want IPv6 link-local address on all + interfaces by default, set this to "YES". + + The old ipv6_prefer="YES" is equivalent to + ipv6_activate_all_interfaces="YES" and + ip6addrctl_policy="ipv6_prefer". + +20100913: DTrace has grown support for userland tracing. Due to this, DTrace is now i386 and amd64 only. dtruss(1) is now installed by default on those systems and a new Modified: head/etc/defaults/rc.conf == --- head/etc/defaults/rc.conf Mon Sep 13 19:53:54 2010(r212578) +++ head/etc/defaults/rc.conf Mon Sep 13 19:55:40 2010(r212579) @@ -446,6 +446,10 @@ icmp_bmcastecho="NO" # respond to broadc ### IPv6 options: ### ipv6_network_interfaces="auto" # List of IPv6 network interfaces # (or "auto" or "none"). +ipv6_activate_all_interfaces="NO" # If NO, interfaces which have no + # corresponding $ifconfig_IF_ipv6 is + # marked as IFDISABLED for security + # reason. ipv6_defaultrouter="NO"# Set to IPv6 default gateway (or NO). #ipv6_defaultrouter="2002:c058:6301::" # Use this for 6to4 (RFC 3068) ipv6_static_routes="" # Set to static route list (or leave empty). @@ -506,7 +510,8 @@ ipv6_ipfilter_rules="/etc/ipf6.rules" # # for examples ip6addrctl_enable="YES"# Set to YES to enable default address selection ip6addrctl_verbose="NO"# Set to YES to enable verbose configuration messages -ipv6_prefer="NO" # Use IPv6 when both IPv4 and IPv6 can be used +ip6addrctl_policy="AUTO" # A pre-defined address selection policy + # (ipv4_prefer, ipv6_prefer, or AUTO) ## ### System console options # Modified: head/etc/network.subr == --- head/etc/network.subr Mon Sep 13 19:53:54 2010(r212578) +++ head/etc/network.subr Mon Sep 13 19:55:40 2010(r212579) @@ -100,7 +100,7 @@ ifconfig_up() _ipv6_opts="-accept_rtadv" fi else - if checkyesno ipv6_prefer; then + if checkyesno ipv6_activate_all_interfaces; then _ipv6_opts="-ifdisabled" else _ipv6_opts="ifdisabled" Modified: head/etc/rc.d/ip6addrctl == --- head/etc/rc.d/ip6addrctl
svn commit: r213381 - head/release/powerpc
Author: hrs Date: Sun Oct 3 13:13:10 2010 New Revision: 213381 URL: http://svn.freebsd.org/changeset/base/213381 Log: Replace an obsolete flag -L in an mkisofs(1) command line with -allow-leading-dots to fix "make release" for FreeBSD/powerpc. Reviewed by: marcel Modified: head/release/powerpc/mkisoimages.sh Modified: head/release/powerpc/mkisoimages.sh == --- head/release/powerpc/mkisoimages.sh Sun Oct 3 08:57:02 2010 (r213380) +++ head/release/powerpc/mkisoimages.sh Sun Oct 3 13:13:10 2010 (r213381) @@ -54,4 +54,4 @@ fi LABEL=$1; shift NAME=$1; shift -mkisofs $bootable -r -hfs -part -no-desktop -hfs-volid $LABEL -l -J -L -o $NAME $* +mkisofs $bootable -r -hfs -part -no-desktop -hfs-volid $LABEL -l -J -allow-leading-dots -o $NAME $* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r216288 - head/share/man/man5
Author: hrs Date: Wed Dec 8 07:10:25 2010 New Revision: 216288 URL: http://svn.freebsd.org/changeset/base/216288 Log: Fix a typo. Submitted by: Garrett Cooper Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 == --- head/share/man/man5/rc.conf.5 Wed Dec 8 07:00:53 2010 (r216287) +++ head/share/man/man5/rc.conf.5 Wed Dec 8 07:10:25 2010 (r216288) @@ -1293,7 +1293,7 @@ the default address selection policy tab will be IPv4-preferred. .Pp This variable is deprecated. Use -.Va ip6addtctl_policy +.Va ip6addrctl_policy instead. .It Va ipv6_activate_all_interfaces If the variable is ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r224533 - head/share/man/man4
Hi Joel, Joel Dahl wrote in <201107302309.p6un9rhj019...@svn.freebsd.org>: jo> Author: joel (doc committer) jo> Date: Sat Jul 30 23:09:52 2011 jo> New Revision: 224533 jo> URL: http://svn.freebsd.org/changeset/base/224533 jo> jo> Log: jo> Add a better description, a few examples and a couple of minor fixes. jo> jo> Reviewed by: brueffer jo> Approved by: re (kib) jo> jo> Modified: jo> head/share/man/man4/pcm.4 jo> jo> Modified: head/share/man/man4/pcm.4 jo> == (snip) jo> @@ -173,7 +244,7 @@ controls (bass and treble). jo> Commonly used for ear-candy or frequency compensation due to the vast jo> difference in hardware quality. jo> EQ is disabled by default, but can be enabled with the jo> -.Va hint.pcm. Ns Ao Ar X Ac Ns Va .eq jo> +.Va hint.pcm.%d.eq : jo> -.It Va hint.pcm. Ns Ao Ar X Ac Ns Va .eq jo> +.It Va hint.pcm.%d.eq : jo> -.It Va hint.pcm. Ns Ao Ar X Ac Ns Va .vpc jo> +.It Va hint.pcm.%d.vpc I know several manual pages are also using this expression (%d) for replaceables, but I am wondering if this is friendly for average users. Is ".Ar N" for an integer problematic, for example? I would like comments since other documents in DocBook have used such a notation for a long time and I feel we need consistency with them. -- Hiroki pgpHvfkTcpuoF.pgp Description: PGP signature
svn commit: r224701 - head/lib/libc/net
Author: hrs Date: Mon Aug 8 03:09:03 2011 New Revision: 224701 URL: http://svn.freebsd.org/changeset/base/224701 Log: Fix a pathname (s,netinet/if_ether.h,net/ethernet.h,). PR: docs/159341 Submitted by: Garrett Cooper Approved by: re (kib) Modified: head/lib/libc/net/ethers.3 Modified: head/lib/libc/net/ethers.3 == --- head/lib/libc/net/ethers.3 Sun Aug 7 20:24:32 2011(r224700) +++ head/lib/libc/net/ethers.3 Mon Aug 8 03:09:03 2011(r224701) @@ -68,7 +68,7 @@ These functions operate on ethernet addresses using an .Vt ether_addr structure, which is defined in the header file -.In netinet/if_ether.h : +.In net/ethernet.h : .Bd -literal -offset indent /* * The number of bytes in an ethernet (MAC) address. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r224674 - head/etc
Garrett Cooper wrote in : ya> On Sun, Aug 7, 2011 at 9:12 PM, Doug Barton wrote: ya> > On 8/7/2011 6:05 PM, Garrett Cooper wrote: ya> >> On Sun, Aug 7, 2011 at 1:51 PM, Simon L. B. Nielsen wrote: ya> >>> ya> >>> On 6 Aug 2011, at 11:16, Doug Barton wrote: ya> >>> ya> Author: dougb ya> Date: Sat Aug 6 09:16:53 2011 ya> New Revision: 224674 ya> URL: http://svn.freebsd.org/changeset/base/224674 ya> ya> Log: ya> Rather than edit the nsswitch.conf file based on ${MK_NIS} == "no" ya> comment out the NIS _compat options by default, but leave them in ya> the file for the convenience of users who want to enable it. ya> ya> Update the comment in the file accordingly. ya> >>> ya> >>> This disables NIS by default which is rather surprising considering there has been no prior (which I have been able to find) discussion of this. ya> >>> ya> >>> At the _VERY_ least people need to be warned about this loudly. Unless you can show this really helps non-NIS users this is IMO a bad idea. ya> >>> ya> >>> Yes, if you hand merge all /etc files this won't be a problem... but I don't since life's to short for that, so this change just broke login on one of the FreeBSD.org during an upgrade. ya> > ya> > mergemaster has been in the tree for almost 12 years now. :) In any ya> > case, I can't think of a situation where blindly copying new files to ya> > /etc is a good idea (with all due respect). ya> > ya> >> non-POLA changes are bad, and this _definitely_ deserves an UPDATING ya> >> entry and/or further discussion. ya> > ya> > I'm happy to ask for permission to do the UPDATING entry, do you have ya> > suggestions for the text? ya> ya> Maybe this? ya> -Garrett Could you all please discuss this topic on -current? I was not fully aware of the impact and possible controversy when I approved this change (sorry), but simon@'s comment implies an objection against the change as well as a suggestion to discuss it for a consensus. I think it is better to discuss this on a (more) public mailing list before taking further actions. -- Hiroki pgpMpKW8nCtIW.pgp Description: PGP signature
svn commit: r225519 - in head/usr.sbin: rtadvctl rtadvd
Author: hrs Date: Mon Sep 12 23:52:55 2011 New Revision: 225519 URL: http://svn.freebsd.org/changeset/base/225519 Log: - Fix a bug that can lead to displaying an incorrect value. (r224210) - Fix an abnormal termination caused by twice of "rtadvctl disable". (r224303) - Use poll() to wait for the control message socket instead of a spin loop. (r224304) - s/cmsg_/cm_/ to avoid conflict with CMSG_* symbols for struct cmsghdr. (r224619) - Ignore an interface that never sent RAs for graceful shut-down. (r224620) - Refine log messages. (r225148) - Fix SIGSEGV when receiving RAs that contain RDNSS and/or DNSSL options. (r225149) Approved by: re (kib) Modified: head/usr.sbin/rtadvctl/rtadvctl.c head/usr.sbin/rtadvd/control.c head/usr.sbin/rtadvd/control.h head/usr.sbin/rtadvd/control_client.c head/usr.sbin/rtadvd/control_client.h head/usr.sbin/rtadvd/control_server.c head/usr.sbin/rtadvd/control_server.h head/usr.sbin/rtadvd/rtadvd.c Directory Properties: head/usr.sbin/rtadvctl/ (props changed) head/usr.sbin/rtadvd/ (props changed) Modified: head/usr.sbin/rtadvctl/rtadvctl.c == --- head/usr.sbin/rtadvctl/rtadvctl.c Mon Sep 12 21:09:56 2011 (r225518) +++ head/usr.sbin/rtadvctl/rtadvctl.c Mon Sep 12 23:52:55 2011 (r225519) @@ -260,13 +260,13 @@ action_plgeneric(int action, char *plstr *q++ = '\0'; cp.cp_val = q; } - cm->cm_len += cmsg_pl2bin(msg, &cp); + cm->cm_len += cm_pl2bin(msg, &cp); mysyslog(LOG_DEBUG, "<%s> key=%s, val_len=%d, ifname=%s", __func__,cp.cp_key, cp.cp_val_len, cp.cp_ifname); } - return (cmsg_handler_client(s->si_fd, CM_STATE_MSG_DISPATCH, buf)); + return (cm_handler_client(s->si_fd, CM_STATE_MSG_DISPATCH, buf)); } static int @@ -285,7 +285,7 @@ action_propget(char *argv, struct ctrl_m if (error || cm->cm_len <= sizeof(*cm)) return (1); - cmsg_bin2pl(msg, cp); + cm_bin2pl(msg, cp); mysyslog(LOG_DEBUG, "<%s> type=%d, len=%d", __func__, cm->cm_type, cm->cm_len); mysyslog(LOG_DEBUG, "<%s> key=%s, val_len=%d, ifname=%s", @@ -571,9 +571,9 @@ action_show(int argc, char **argv) printf("\n"); - printf("\tMinAdvInterval/MaxAdvInterval: %s/%s\n", - sec2str(rai->rai_mininterval, ssbuf), - sec2str(rai->rai_maxinterval, ssbuf)); + printf("\tMinAdvInterval/MaxAdvInterval: "); + printf("%s/", sec2str(rai->rai_mininterval, ssbuf)); + printf("%s\n", sec2str(rai->rai_maxinterval, ssbuf)); if (rai->rai_linkmtu) printf("\tAdvLinkMTU: %d", rai->rai_linkmtu); else @@ -593,11 +593,10 @@ action_show(int argc, char **argv) printf("Preference: %s\n", rtpref_str[(rai->rai_rtpref >> 3) & 0xff]); - printf("\t" - "ReachableTime: %s, " - "RetransTimer: %s, " + printf("\tReachableTime: %s, ", + sec2str(rai->rai_reachabletime, ssbuf)); + printf("RetransTimer: %s, " "CurHopLimit: %d\n", - sec2str(rai->rai_reachabletime, ssbuf), sec2str(rai->rai_retranstimer, ssbuf), rai->rai_hoplimit); printf("\tAdvIfPrefixes: %s\n", Modified: head/usr.sbin/rtadvd/control.c == --- head/usr.sbin/rtadvd/control.c Mon Sep 12 21:09:56 2011 (r225518) +++ head/usr.sbin/rtadvd/control.c Mon Sep 12 23:52:55 2011 (r225519) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -53,12 +54,16 @@ #include "pathnames.h" #include "control.h" +#defineCM_RECV_TIMEOUT 30 + int -cmsg_recv(int fd, char *buf) +cm_recv(int fd, char *buf) { int n; struct ctrl_msg_hdr *cm; char *msg; + struct pollfd pfds[1]; + int i; syslog(LOG_DEBUG, "<%s> enter, fd=%d", __func__, fd); @@ -66,35 +71,52 @@ cmsg_recv(int fd, char *buf) cm = (struct ctrl_msg_hdr *)buf; msg = (char *)buf + sizeof(*cm); + pfds[0].fd = fd; + pfds[0].events = POLLIN; + for (;;) { - n = read(fd, cm, sizeof(*cm)); - if (n < 0 && errno == EAGAIN) { - syslog(LOG_DEBUG, - "<%s> waiting...", __func__); + i = poll(pfds, sizeof(pfds)/sizeof(pfds[0]), + CM_RECV_TIMEOUT); + + if (i == 0) + continue; + + if (i < 0) { + syslog(LOG_ERR, "<%s>
svn commit: r225520 - head/usr.sbin/rtsold
Author: hrs Date: Mon Sep 12 23:55:23 2011 New Revision: 225520 URL: http://svn.freebsd.org/changeset/base/225520 Log: - Add ":origin" label to the interface id for resolvconf(8). (r223149) - Add -u option to enable adding :[RA-source-address] to the interface id. (r223149) - s/INET6_ADDRSTRLEN/sizeof(ntopbuf)/ (r223149) - Fix a bug that can prevent -D from being overridden by -d. (r223149) - /-P pidfile/-p pidfile/ for consistency with rtadvd(8). (r223149) - Fix -F flag handling to support receiving RAs even when ip6.forwarding=1. (r225150) Approved by: re (kib) Modified: head/usr.sbin/rtsold/rtsol.c head/usr.sbin/rtsold/rtsold.8 head/usr.sbin/rtsold/rtsold.c head/usr.sbin/rtsold/rtsold.h Directory Properties: head/usr.sbin/rtsold/ (props changed) Modified: head/usr.sbin/rtsold/rtsol.c == --- head/usr.sbin/rtsold/rtsol.cMon Sep 12 23:52:55 2011 (r225519) +++ head/usr.sbin/rtsold/rtsol.cMon Sep 12 23:55:23 2011 (r225520) @@ -73,6 +73,7 @@ static struct sockaddr_in6 from; static int rcvcmsglen; int rssock; +static char rsid[IFNAMSIZ + 1 + sizeof(DNSINFO_ORIGIN_LABEL) + 1 + NI_MAXHOST]; struct ifinfo_head_t ifinfo_head = TAILQ_HEAD_INITIALIZER(ifinfo_head); @@ -82,14 +83,18 @@ static const struct sockaddr_in6 sin6_al .sin6_addr =IN6ADDR_LINKLOCAL_ALLROUTERS_INIT, }; -static void call_script(const int, const char *const *, void *); +static void call_script(const int, const char *const *, +struct script_msg_head_t *); static size_t dname_labeldec(char *, size_t, const char *); static int safefile(const char *); static struct ra_opt *find_raopt(struct rainfo *, int, void *, size_t); +static int ra_opt_rdnss_dispatch(struct ifinfo *, struct rainfo *, +struct script_msg_head_t *, struct script_msg_head_t *); +static char *make_rsid(const char *, const char *, struct rainfo *); #define_ARGS_OTHER otherconf_script, ifi->ifname -#define_ARGS_RESADDresolvconf_script, "-a", ifi->ifname -#define_ARGS_RESDELresolvconf_script, "-d", ifi->ifname +#define_ARGS_RESADDresolvconf_script, "-a", rsid +#define_ARGS_RESDELresolvconf_script, "-d", rsid #defineCALL_SCRIPT(name, sm_head) \ do {\ @@ -306,7 +311,7 @@ rtsol_input(int s) warnmsg(LOG_ERR, __func__, "invalid icmp type(%d) from %s on %s", icp->icmp6_type, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, - INET6_ADDRSTRLEN), + sizeof(ntopbuf)), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); return; } @@ -315,7 +320,7 @@ rtsol_input(int s) warnmsg(LOG_INFO, __func__, "invalid icmp code(%d) from %s on %s", icp->icmp6_code, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, - INET6_ADDRSTRLEN), + sizeof(ntopbuf)), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); return; } @@ -325,7 +330,7 @@ rtsol_input(int s) "invalid RA with hop limit(%d) from %s on %s", *hlimp, inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, - INET6_ADDRSTRLEN), + sizeof(ntopbuf)), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); return; } @@ -334,7 +339,7 @@ rtsol_input(int s) warnmsg(LOG_INFO, __func__, "invalid RA with non link-local source from %s on %s", inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, - INET6_ADDRSTRLEN), + sizeof(ntopbuf)), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); return; } @@ -345,14 +350,14 @@ rtsol_input(int s) warnmsg(LOG_INFO, __func__, "received RA from %s on an unexpected IF(%s)", inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, - INET6_ADDRSTRLEN), + sizeof(ntopbuf)), if_indextoname(pi->ipi6_ifindex, ifnamebuf)); return; } warnmsg(LOG_DEBUG, __func__, "received RA from %s on %s, state is %d", - inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, INET6_ADDRSTRLEN), + inet_ntop(AF_INET6, &from.sin6_addr, ntopbuf, sizeof(ntopbuf)), ifi->ifname, ifi->state); nd_ra = (struct nd_router_advert *)icp; @@ -378,6 +383,8 @@ rtsol_input(int s) ELM_MALLOC(rai, exit(1)); rai->rai_ifinfo = ifi; TAILQ_INIT(&rai->rai_ra_opt); + rai->rai_s
svn commit: r225521 - in head: etc etc/defaults etc/rc.d sys/netinet6
Author: hrs Date: Tue Sep 13 00:06:11 2011 New Revision: 225521 URL: http://svn.freebsd.org/changeset/base/225521 Log: Add $ipv6_cpe_wanif to enable functionality required for IPv6 CPE (r225485). When setting an interface name to it, the following configurations will be enabled: 1. "no_radr" is set to all IPv6 interfaces automatically. 2. "-no_radr accept_rtadv" will be set only for $ipv6_cpe_wanif. This is done just before evaluating $ifconfig_IF_ipv6 in the rc.d scripts (this means you can manually supersede this configuration if necessary). 3. The node will add RA-sending routers to the default router list even if net.inet6.ip6.forwarding=1. This mode is added to conform to RFC 6204 (a router which connects the end-user network to a service provider network). To enable packet forwarding, you still need to set ipv6_gateway_enable=YES. Note that accepting router entries into the default router list when packet forwarding capability and a routing daemon are enabled can result in messing up the routing table. To minimize such unexpected behaviors, "no_radr" is set on all interfaces but $ipv6_cpe_wanif. Approved by: re (bz) Modified: head/etc/defaults/rc.conf head/etc/network.subr head/etc/rc.d/netoptions head/sys/netinet6/in6.h head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_var.h head/sys/netinet6/nd6_rtr.c Modified: head/etc/defaults/rc.conf == --- head/etc/defaults/rc.conf Mon Sep 12 23:55:23 2011(r225520) +++ head/etc/defaults/rc.conf Tue Sep 13 00:06:11 2011(r225521) @@ -468,6 +468,9 @@ ipv6_static_routes="" # Set to static r # route toward loopback interface. #ipv6_route_xxx="fec0:::0006:: -prefixlen 64 ::1" ipv6_gateway_enable="NO" # Set to YES if this host will be a gateway. +ipv6_cpe_wanif="NO"# Set to the upstram interface name if this + # node will work as a router to forward IPv6 + # packets not explicitly addressed to itself. ipv6_privacy="NO" # Use privacy address on RA-receiving IFs # (RFC 4193) Modified: head/etc/network.subr == --- head/etc/network.subr Mon Sep 12 23:55:23 2011(r225520) +++ head/etc/network.subr Tue Sep 13 00:06:11 2011(r225521) @@ -113,6 +113,12 @@ ifconfig_up() ;; esac + case $ipv6_cpe_wanif in + $1) + _ipv6_opts="${_ipv6_opts} -no_radr accept_rtadv" + ;; + esac + if [ -n "${_ipv6_opts}" ]; then ifconfig $1 inet6 ${_ipv6_opts} fi Modified: head/etc/rc.d/netoptions == --- head/etc/rc.d/netoptionsMon Sep 12 23:55:23 2011(r225520) +++ head/etc/rc.d/netoptionsTue Sep 13 00:06:11 2011(r225521) @@ -106,6 +106,19 @@ netoptions_inet6() ${SYSCTL} net.inet6.ip6.use_tempaddr=1 >/dev/null ${SYSCTL} net.inet6.ip6.prefer_tempaddr=1 >/dev/null fi + + case $ipv6_cpe_wanif in + ""|[Nn][Oo]|[Nn][Oo][Nn][Ee]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) + ${SYSCTL} net.inet6.ip6.no_radr=0 >/dev/null + ${SYSCTL} net.inet6.ip6.rfc6204w3=0 >/dev/null + ;; + *) + netoptions_init + echo -n " IPv6 CPE WANIF=${ipv6_cpe_wanif}" + ${SYSCTL} net.inet6.ip6.no_radr=1 >/dev/null + ${SYSCTL} net.inet6.ip6.rfc6204w3=1 >/dev/null + ;; + esac } load_rc_config $name Modified: head/sys/netinet6/in6.h == --- head/sys/netinet6/in6.h Mon Sep 12 23:55:23 2011(r225520) +++ head/sys/netinet6/in6.h Tue Sep 13 00:06:11 2011(r225521) @@ -614,7 +614,9 @@ struct ip6_mtuinfo { #defineIPV6CTL_NO_RADR 48 /* No defroute from RA */ #defineIPV6CTL_NORBIT_RAIF 49 /* Disable R-bit in NA on RA * receiving IF. */ -#defineIPV6CTL_MAXID 50 +#defineIPV6CTL_RFC6204W3 50 /* Accept defroute even when forwarding + enabled */ +#defineIPV6CTL_MAXID 51 #endif /* __BSD_VISIBLE */ /* Modified: head/sys/netinet6/in6_proto.c == --- head/sys/netinet6/in6_proto.c Mon Sep 12 23:55:23 2011 (r225520) +++ head/sys/netinet6/in6_proto.c Tue Sep 13 00:06:11 2011 (r225521) @@
svn commit: r225522 - head/etc
Author: hrs Date: Tue Sep 13 00:09:47 2011 New Revision: 225522 URL: http://svn.freebsd.org/changeset/base/225522 Log: - Add an warning when ifconfig_IF_ipv6 has no inet6 keyword in front of an IPv6 address. (r225489) - Use eval for ${ifconfig_args} to fix an issue fixed in r223506. (r225489) Approved by: re (bz) Modified: head/etc/network.subr Modified: head/etc/network.subr == --- head/etc/network.subr Tue Sep 13 00:06:11 2011(r225521) +++ head/etc/network.subr Tue Sep 13 00:09:47 2011(r225522) @@ -126,8 +126,16 @@ ifconfig_up() # ifconfig_IF_ipv6 ifconfig_args=`ifconfig_getargs $1 ipv6` if [ -n "${ifconfig_args}" ]; then + # backward compatibility: inet6 keyword + case "${ifconfig_args}" in + :*|[0-9a-fA-F]*:*) + warn "\$ifconfig_$1_ipv6 needs " \ + "\"inet6\" keyword for an IPv6 address." + ifconfig_args="inet6 ${ifconfig_args}" + ;; + esac ifconfig $1 inet6 -ifdisabled - ifconfig $1 ${ifconfig_args} + eval ifconfig $1 ${ifconfig_args} _cfg=0 fi @@ -137,7 +145,7 @@ ifconfig_up() warn "\$ipv6_ifconfig_$1 is obsolete." \ " Use ifconfig_$1_ipv6 instead." ifconfig $1 inet6 -ifdisabled - ifconfig $1 inet6 ${ifconfig_args} + eval ifconfig $1 inet6 ${ifconfig_args} _cfg=0 fi fi ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225524 - head/contrib/openresolv
Author: hrs Date: Tue Sep 13 02:46:22 2011 New Revision: 225524 URL: http://svn.freebsd.org/changeset/base/225524 Log: Merge from openresolv 3.4.4 in the vendor branch. Approved by: re (kib) Modified: head/contrib/openresolv/dnsmasq.in head/contrib/openresolv/libc.in head/contrib/openresolv/named.in head/contrib/openresolv/pdnsd.in head/contrib/openresolv/resolvconf.in head/contrib/openresolv/unbound.in Directory Properties: head/contrib/openresolv/ (props changed) Modified: head/contrib/openresolv/dnsmasq.in == --- head/contrib/openresolv/dnsmasq.in Tue Sep 13 02:41:09 2011 (r225523) +++ head/contrib/openresolv/dnsmasq.in Tue Sep 13 02:46:22 2011 (r225524) @@ -30,12 +30,14 @@ . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$dnsmasq_conf" -a -z "$dnsmasq_resolv" ] && exit 0 [ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +NL=" +" : ${dnsmasq_pid:=/var/run/dnsmasq.pid} [ -s "$dnsmasq_pid" ] || dnsmasq_pid=/var/run/dnsmasq/dnsmasq.pid : ${dnsmasq_service:=dnsmasq} : ${dnsmasq_restart:=@RESTARTCMD ${dnsmasq_service}@} -newconf="# Generated by resolvconf\n" +newconf="# Generated by resolvconf$NL" newresolv="$newconf" # Using dbus means that we never have to restart the daemon @@ -56,14 +58,14 @@ if [ -s "$dbus_pid" -a -s "$dnsmasq_pid" kill -0 $(cat "$dnsmasq_pid") 2>/dev/null then dbus=true - newconf="$newconf\n# Domain specific servers will" - newconf="$newconf be sent over dbus\nenable-dbus\n" + newconf="$newconf$NL# Domain specific servers will" + newconf="$newconf be sent over dbus${NL}enable-dbus$NL" fi fi fi for n in $NAMESERVERS; do - newresolv="${newresolv}nameserver $n\n" + newresolv="${newresolv}nameserver $n$NL" done dbusdest= @@ -75,16 +77,16 @@ for d in $DOMAINS; do SIFS=${IFS-y} OIFS=$IFS IFS=. set -- ${ns%%,*} - num="0x$(printf "%02x" $1 $2 $3 $4)" + num="0x$(printf %02x $1 $2 $3 $4)" if [ "$SIFS" = yi ]; then unset IFS else IFS=$OIFS fi - dbusdest="$dbusdest uint32:$(printf "%u" $num)" + dbusdest="$dbusdest uint32:$(printf %u $num)" dbusdest="$dbusdest string:$dn" else - newconf="${newconf}server=/$dn/${ns%%,*}\n" + newconf="${newconf}server=/$dn/${ns%%,*}$NL" fi [ "$ns" = "${ns#*,}" ] && break ns="${ns#*,}" @@ -94,22 +96,22 @@ done changed=false if [ -n "$dnsmasq_conf" ]; then if [ ! -f "$dnsmasq_conf" ] || \ - [ "$(cat "$dnsmasq_conf")" != "$(printf "$newconf")" ] + [ "$(cat "$dnsmasq_conf")" != "$(printf %s "$newconf")" ] then changed=true - printf "$newconf" >"$dnsmasq_conf" + printf %s "$newconf" >"$dnsmasq_conf" fi fi if [ -n "$dnsmasq_resolv" ]; then if [ -f "$dnsmasq_resolv" ]; then - if [ "$(cat "$dnsmasq_resolv")" != "$(printf "$newresolv")" ] + if [ "$(cat "$dnsmasq_resolv")" != "$(printf %s "$newresolv")" ] then changed=true - printf "$newresolv" >"$dnsmasq_resolv" + printf %s "$newresolv" >"$dnsmasq_resolv" fi else # dnsmasq polls this file so no need to set changed=true - printf "$newresolv" >"$dnsmasq_resolv" + printf %s "$newresolv" >"$dnsmasq_resolv" fi fi Modified: head/contrib/openresolv/libc.in == --- head/contrib/openresolv/libc.in Tue Sep 13 02:41:09 2011 (r225523) +++ head/contrib/openresolv/libc.in Tue Sep 13 02:46:22 2011 (r225524) @@ -30,6 +30,8 @@ SYSCONFDIR=@SYSCONFDIR@ LIBEXECDIR=@LIBEXECDIR@ VARDIR=@VARDIR@ IFACEDIR="$VARDIR/interfaces" +NL=" +" # sed may not be available, and this is faster on small files key_get_value() @@ -109,7 +111,7 @@ case "${resolv_conf_passthrough:-NO}" in fi done [ -z "$newest" ] && exit 0 - newconf="$(cat "$newest")\n" + newconf="$(cat "$newest")$NL" ;; *) [ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" @@ -118,13 +120,13 @@ case "${resolv_conf_passthrough:-NO}" in newns="$(uniqify $name_servers $NS $name_servers_append)" # Hold our new resolv.conf in a variable to save on temporary files
svn commit: r225669 - head/etc/rc.d
Author: hrs Date: Mon Sep 19 15:55:53 2011 New Revision: 225669 URL: http://svn.freebsd.org/changeset/base/225669 Log: Fix the script order to run rc.d/bridge after the initial network interface configuration and before running network daemons. Approved by: re (kib) Modified: head/etc/rc.d/bridge Modified: head/etc/rc.d/bridge == --- head/etc/rc.d/bridgeMon Sep 19 15:31:12 2011(r225668) +++ head/etc/rc.d/bridgeMon Sep 19 15:55:53 2011(r225669) @@ -26,7 +26,8 @@ # # PROVIDE: bridge -# REQUIRE: netif +# REQUIRE: netif faith ppp stf +# BEFORE: SERVERS # KEYWORD: nojail . /etc/rc.subr ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225670 - head/etc/rc.d
Author: hrs Date: Mon Sep 19 15:56:50 2011 New Revision: 225670 URL: http://svn.freebsd.org/changeset/base/225670 Log: Use resolvconf(8) to create /etc/resolv.conf, not directly overwrite it. Approved by: re (kib) Modified: head/etc/rc.d/resolv Modified: head/etc/rc.d/resolv == --- head/etc/rc.d/resolvMon Sep 19 15:55:53 2011(r225669) +++ head/etc/rc.d/resolvMon Sep 19 15:56:50 2011(r225670) @@ -28,7 +28,7 @@ # # PROVIDE: resolv -# REQUIRE: netif +# REQUIRE: netif var # KEYWORD: nojail . /etc/rc.subr @@ -41,17 +41,17 @@ load_rc_config $name # if the info is available via dhcp/kenv # build the resolv.conf # -if [ ! -e /etc/resolv.conf -a \ --n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then - > /etc/resolv.conf - +if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then + interface="`/bin/kenv boot.netif.name`" + ( if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then - echo domain `/bin/kenv dhcp.domain-name` > /etc/resolv.conf + echo domain `/bin/kenv dhcp.domain-name` fi set -- `/bin/kenv dhcp.domain-name-servers` for ns in `IFS=','; echo $*`; do - echo nameserver $ns >> /etc/resolv.conf; + echo nameserver $ns done + ) | /sbin/resolvconf -a ${interface}:dhcp4 fi ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225671 - head/share/man/man5
Author: hrs Date: Mon Sep 19 16:00:55 2011 New Revision: 225671 URL: http://svn.freebsd.org/changeset/base/225671 Log: - Document $ipv6_cpe_wanif. - Emphasize $ipv6_enable and $ipv6_prefer are deprecated. - Add more detail descriptions about $ipv6_activate_all_interfaces. - Add some more examples of $ifconfig_IF_ipv6. - rtsold(8) and rtadvd(8) can be used even when ipv6_gateway_enable=NO now. Approved by: re (kib) Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 == --- head/share/man/man5/rc.conf.5 Mon Sep 19 15:56:50 2011 (r225670) +++ head/share/man/man5/rc.conf.5 Mon Sep 19 16:00:55 2011 (r225671) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 19, 2011 +.Dd September 13, 2011 .Dt RC.CONF 5 .Os .Sh NAME @@ -1282,6 +1282,13 @@ ifconfig_ed0_name="net0" ifconfig_net0="inet 192.0.2.1 netmask 0xff00" .Ed .It Va ipv6_enable +This variable is deprecated. +Use +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +and +.Va ipv6_activate_all_interfaces +if necessary. +.Pp .Pq Vt bool If the variable is .Dq Li YES , @@ -1292,13 +1299,12 @@ and the .Va ipv6_activate_all_interfaces is defined as .Dq Li YES . -.Pp -This variable is deprecated. Use -.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 -and -.Va ipv6_activate_all_interfaces -if necessary. .It Va ipv6_prefer +This variable is deprecated. +Use +.Va ip6addrctl_policy +instead. +.Pp .Pq Vt bool If the variable is .Dq Li YES , @@ -1311,19 +1317,45 @@ If the variable is the default address selection policy table set by .Xr ip6addrctl 8 will be IPv4-preferred. -.Pp -This variable is deprecated. Use -.Va ip6addrctl_policy -instead. .It Va ipv6_activate_all_interfaces +.Pq Vt bool +This controls initial configuration on IPv6-capable +interfaces with no corresponding +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +variable. +Note that it is not always necessary to set this variable to +.Dq YES +to use IPv6 functionality on +.Fx . +In most cases, just configuring +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +variables works. +.Pp If the variable is .Dq Li NO , -all of interfaces which do not have the corrsponding +all interfaces which do not have a corresponding .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 variable will be marked as .Dq Li IFDISABLED -for security reason. This means only IPv6 functionality on that interface -is completely disabled. For more details of +at creation. +This means that all of IPv6 functionality on that interface +is completely disabled to enforce a security policy. +If the variable is set to +.Dq YES , +the flag will be cleared on all of the interfaces. +.Pp +In most cases, just defining an +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +for an IPv6-capable interface should be sufficient. +However, if an interface is added dynamically +.Pq by some tunneling protocols such as PPP, for example , +it is often difficult to define the variable in advance. +In such a case, configuring the +.Dq Li IFDISABLED +flag can be disabled by setting this variable to +.Dq YES . +.Pp +For more details of the .Dq Li IFDISABLED flag and keywords .Dq Li inet6 ifdisabled , @@ -1344,6 +1376,47 @@ This is the IPv6 equivalent of .Va network_interfaces . Normally manual configuration of this variable is not needed. .Pp +.It Va ipv6_cpe_wanif +.Pq Vt str +If the variable is set to an interface name, +the +.Xr ifconfig 8 +options +.Dq inet6 -no_radr accept_rtadv +will be added to the specified interface automatically before evaluating +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 , +and two +.Xr sysctl 8 +variables +.Va net.inet6.ip6.rfc6204w3 +and +.Va net.inet6.ip6.no_radr +will be set to 1. +.Pp +This means the specified interface will accept ICMPv6 Router +Advertisement messages on that link and add the discovered +routers into the Default Router List. +While the other interfaces can still accept RA messages if the +.Dq inet6 accept_rtadv +option is specified, adding +routes into the Default Router List will be disabled by +.Dq inet6 no_radr +option by default. +See +.Xr ifconfig 8 +for more details. +.Pp +Note that ICMPv6 Router Advertisement messages will be +accepted even when +.Va net.inet6.ip6.forwarding +is 1 +.Pq packet fowarding is enabled +when +.Va net.inet6.ip6.rfc6204w3 +is set to 1. +.Pp +Default is +.Dq Li NO . .It Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 .Pq Vt str IPv6 functionality on an interface should be configured by @@ -1360,16 +1433,37 @@ ifconfig_ed0_ipv6="inet6 2001:db8:1::1 p ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" .Ed .Pp +Note that a link-local address will be automatically configured in +addition to the configured global-scope addresses because the IPv6 +specifications require it on each link. +The address is calculated from the MAC address by using an algorithm +defined in +.Rs +.%T "RFC 4862" +.%O "Section 5.3" +.Re +.Pp +
svn commit: r225672 - head/sbin/ifconfig
Author: hrs Date: Mon Sep 19 16:01:53 2011 New Revision: 225672 URL: http://svn.freebsd.org/changeset/base/225672 Log: - Document inet6 no_radr flag. - Add descriptions of sysctl(8) variables which can control the default configuration of the inet6 flags. Approved by: re (kib) Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 == --- head/sbin/ifconfig/ifconfig.8 Mon Sep 19 16:00:55 2011 (r225671) +++ head/sbin/ifconfig/ifconfig.8 Mon Sep 19 16:01:53 2011 (r225672) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd July 3, 2011 +.Dd September 13, 2011 .Dt IFCONFIG 8 .Os .Sh NAME @@ -626,12 +626,37 @@ is needed for them: .Bl -tag -width indent .It Cm accept_rtadv Set a flag to enable accepting ICMPv6 Router Advertisement messages. +The +.Xr sysctl 8 +variable +.Va net.inet6.ip6.accept_rtadv +controls whether this flag is set by default or not. .It Cm -accept_rtadv Clear a flag .Cm accept_rtadv . +.It Cm no_radr +Set a flag to control whether routers from which the system accepts +Router Advertisement messages will be added to the Default Router List +or not. +When the +.Cm accept_rtadv +flag is disabled, this flag has no effect. +The +.Xr sysctl 8 +variable +.Va net.inet6.ip6.no_radr +controls whether this flag is set by default or not. +.It Cm -no_radr +Clear a flag +.Cm no_radr . .It Cm auto_linklocal Set a flag to perform automatic link-local address configuration when the interface becomes available. +The +.Xr sysctl 8 +variable +.Va net.inet6.ip6.auto_linklocal +controls whether this flag is set by default or not. .It Cm -auto_linklocal Clear a flag .Cm auto_linklocal . ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225682 - head/sys/netinet6
Author: hrs Date: Tue Sep 20 00:29:17 2011 New Revision: 225682 URL: http://svn.freebsd.org/changeset/base/225682 Log: Copy ip6po_minmtu and ip6po_prefer_tempaddr in ip6_copypktopts(). This fixes inconsistency when options are specified by both setsockopt() and ancillary data types. PR: kern/158307 Approved by: re (bz) Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c == --- head/sys/netinet6/ip6_output.c Tue Sep 20 00:23:59 2011 (r225681) +++ head/sys/netinet6/ip6_output.c Tue Sep 20 00:29:17 2011 (r225682) @@ -2367,6 +2367,8 @@ copypktopts(struct ip6_pktopts *dst, str dst->ip6po_hlim = src->ip6po_hlim; dst->ip6po_tclass = src->ip6po_tclass; dst->ip6po_flags = src->ip6po_flags; + dst->ip6po_minmtu = src->ip6po_minmtu; + dst->ip6po_prefer_tempaddr = src->ip6po_prefer_tempaddr; if (src->ip6po_pktinfo) { dst->ip6po_pktinfo = malloc(sizeof(*dst->ip6po_pktinfo), M_IP6OPT, canwait); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225683 - head/usr.sbin/rtadvd
Author: hrs Date: Tue Sep 20 00:32:30 2011 New Revision: 225683 URL: http://svn.freebsd.org/changeset/base/225683 Log: Remove RA timer on an interface with !IFF_UP actively after starting to send clean-up RA messages for shutting down. The RA timers could prevent the rtadvd daemon from shutting down because ra_output() just ignored !IFF_UP interfaces and TRANSITIVE->UNCONFIGURED state transition never happened due to it. Spotted by: kib Approved by: re (bz) Modified: head/usr.sbin/rtadvd/rtadvd.c Modified: head/usr.sbin/rtadvd/rtadvd.c == --- head/usr.sbin/rtadvd/rtadvd.c Tue Sep 20 00:29:17 2011 (r225682) +++ head/usr.sbin/rtadvd/rtadvd.c Tue Sep 20 00:32:30 2011 (r225683) @@ -381,6 +381,21 @@ rtadvd_shutdown(void) "waiting expiration of the all RA timers."); TAILQ_FOREACH(ifi, &ifilist, ifi_next) { + /* +* Ignore !IFF_UP interfaces in waiting for shutdown. +*/ + if (!(ifi->ifi_flags & IFF_UP) && + ifi->ifi_ra_timer != NULL) { + ifi->ifi_state = IFI_STATE_UNCONFIGURED; + rtadvd_remove_timer(ifi->ifi_ra_timer); + ifi->ifi_ra_timer = NULL; + syslog(LOG_DEBUG, "<%s> %s(idx=%d) is down. " + "Timer removed and marked as UNCONFIGURED.", +__func__, ifi->ifi_ifname, + ifi->ifi_ifindex); + } + } + TAILQ_FOREACH(ifi, &ifilist, ifi_next) { if (ifi->ifi_ra_timer != NULL) break; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225684 - head/etc/rc.d
Author: hrs Date: Tue Sep 20 00:37:35 2011 New Revision: 225684 URL: http://svn.freebsd.org/changeset/base/225684 Log: Use REQUIRE: line to reorder rc.d/bridge instead of BEFORE: line. Pointed out by: dougb Approved by: re (bz) Modified: head/etc/rc.d/NETWORKING head/etc/rc.d/bridge Modified: head/etc/rc.d/NETWORKING == --- head/etc/rc.d/NETWORKINGTue Sep 20 00:32:30 2011(r225683) +++ head/etc/rc.d/NETWORKINGTue Sep 20 00:37:35 2011(r225684) @@ -5,7 +5,7 @@ # PROVIDE: NETWORKING NETWORK # REQUIRE: netif netoptions routing ppp ipfw stf faith -# REQUIRE: defaultroute routed mrouted route6d mroute6d resolv +# REQUIRE: defaultroute routed mrouted route6d mroute6d resolv bridge # This is a dummy dependency, for services which require networking # to be operational before starting. Modified: head/etc/rc.d/bridge == --- head/etc/rc.d/bridgeTue Sep 20 00:32:30 2011(r225683) +++ head/etc/rc.d/bridgeTue Sep 20 00:37:35 2011(r225684) @@ -27,7 +27,6 @@ # PROVIDE: bridge # REQUIRE: netif faith ppp stf -# BEFORE: SERVERS # KEYWORD: nojail . /etc/rc.subr ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"