Date: Mon, 30 Dec 2013 17:56:30 +0200 From: =?ISO-8859-1?Q?=D6zkan_KIRIK?= <ozkan.kirik@gmail.com> To: freebsd-stable <freebsd-stable@freebsd.org> Subject: Fwd: svn commit: r258677 - head/sbin/ipfw Message-ID: <CAAcX-AHkN3mQ4tEYJ9O97VPz1KBruc=VUz65Fu4FMpBm14HHpg@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Hi, When this commit will be MFC'ed to stable/10? Thanks, ---------- Forwarded message ---------- From: Alexander V. Chernikov <melifaro@freebsd.org> Date: Wed, Nov 27, 2013 at 12:10 PM Subject: svn commit: r258677 - head/sbin/ipfw To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Author: melifaro Date: Wed Nov 27 10:10:25 2013 New Revision: 258677 URL: http://svnweb.freebsd.org/changeset/base/258677 Log: Fix key lookup in ipfw(8) broken since r232865. Print warning for IPv4 address strings which are valid in inet_aton() but not valid in inet_pton(). (1) Found by: =D6zkan KIRIK <ozkan.kirik@gmail.com> Submitted by: Ian Smith <smithi@nimnet.asn.au> (1) MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- head/sbin/ipfw/ipfw2.c Wed Nov 27 08:39:48 2013 (r258676) +++ head/sbin/ipfw/ipfw2.c Wed Nov 27 10:10:25 2013 (r258677) @@ -4274,13 +4274,24 @@ table_fill_xentry(char *arg, ipfw_table_ addrlen =3D sizeof(struct in6_addr); } else { /* Port or any other key */ - key =3D strtol(arg, &p, 10); /* Skip non-base 10 entries like 'fa1' */ - if (p !=3D arg) { + key =3D strtol(arg, &p, 10); + if (*p =3D=3D '\0') { pkey =3D (uint32_t *)paddr; *pkey =3D htonl(key); type =3D IPFW_TABLE_CIDR; + masklen =3D 32; addrlen =3D sizeof(uint32_t); + } else if ((p !=3D arg) && (*p =3D=3D '.')) { + /* + * Warn on IPv4 address strings + * which are "valid" for inet_aton() but no= t + * in inet_pton(). + * + * Typical examples: '10.5' or '10.0.0.05' + */ + errx(EX_DATAERR, + "Invalid IPv4 address: %s", arg); } } } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAcX-AHkN3mQ4tEYJ9O97VPz1KBruc=VUz65Fu4FMpBm14HHpg>