net-tools/net-tools-1.60-inet6-lookup.patch

98 lines
3.3 KiB
Diff
Raw Normal View History

2011-12-06 18:15:09 +00:00
diff -up net-tools-1.60/lib/inet6.c.inet6-lookup net-tools-1.60/lib/inet6.c
--- net-tools-1.60/lib/inet6.c.inet6-lookup 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/inet6.c 2011-12-01 17:10:40.057969536 +0100
@@ -149,33 +149,9 @@ static const char *INET6_sprint(struct s
auto-import changelog data from net-tools-1.60-20.1.src.rpm Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20.1 -rebuilt Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20 - interface option now works as described in the man page (#61113). Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19.1 - rebuilt Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19 - Fixed trailing blank bug in hostname output (#101263). - Remove -O2 fir alpha (#78955). - Updated netstat statistic output, was still broken. Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18.1 - rebuilt Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18 - fix ether-wake.c build with gcc 3.3 - rebuilt Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> - rebuilt Wed Jun 04 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16.1 - Bumped release and rebuilt Fri May 23 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16 - Fixed ether-wake usage output (#55801). Thu May 22 2003 Jeremy Katz <katzj@redhat.com> 1.60-15 - fix build with gcc 3.3 Thu May 22 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-14 - Fixed wrong manpage (#55473). Wed May 21 2003 Phil Knirsch <pknirsch@redhat.com> - Added inet6-lookup patch from John van Krieken (#84108). - Fixed outdated link in ifconfig manpage (#91287). Tue May 20 2003 Phil Knirsch <pknirsch@redhat.com> - Fixed incorrect address display for ipx (#46434). - Fixed wrongly installed manpage dirs (#50664). Wed Mar 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-13 - Fixed nameif problem (#85748).
2004-09-09 09:10:51 +00:00
}
-static int INET6_getsock(char *bufp, struct sockaddr *sap)
-{
- struct sockaddr_in6 *sin6;
2011-12-06 18:15:09 +00:00
- char *p;
auto-import changelog data from net-tools-1.60-20.1.src.rpm Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20.1 -rebuilt Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20 - interface option now works as described in the man page (#61113). Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19.1 - rebuilt Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19 - Fixed trailing blank bug in hostname output (#101263). - Remove -O2 fir alpha (#78955). - Updated netstat statistic output, was still broken. Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18.1 - rebuilt Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18 - fix ether-wake.c build with gcc 3.3 - rebuilt Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> - rebuilt Wed Jun 04 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16.1 - Bumped release and rebuilt Fri May 23 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16 - Fixed ether-wake usage output (#55801). Thu May 22 2003 Jeremy Katz <katzj@redhat.com> 1.60-15 - fix build with gcc 3.3 Thu May 22 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-14 - Fixed wrong manpage (#55473). Wed May 21 2003 Phil Knirsch <pknirsch@redhat.com> - Added inet6-lookup patch from John van Krieken (#84108). - Fixed outdated link in ifconfig manpage (#91287). Tue May 20 2003 Phil Knirsch <pknirsch@redhat.com> - Fixed incorrect address display for ipx (#46434). - Fixed wrongly installed manpage dirs (#50664). Wed Mar 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-13 - Fixed nameif problem (#85748).
2004-09-09 09:10:51 +00:00
-
- sin6 = (struct sockaddr_in6 *) sap;
- sin6->sin6_family = AF_INET6;
- sin6->sin6_port = 0;
2011-12-06 18:15:09 +00:00
- sin6->sin6_scope_id = 0;
- sin6->sin6_flowinfo = 0;
auto-import changelog data from net-tools-1.60-20.1.src.rpm Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20.1 -rebuilt Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20 - interface option now works as described in the man page (#61113). Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19.1 - rebuilt Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19 - Fixed trailing blank bug in hostname output (#101263). - Remove -O2 fir alpha (#78955). - Updated netstat statistic output, was still broken. Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18.1 - rebuilt Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18 - fix ether-wake.c build with gcc 3.3 - rebuilt Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> - rebuilt Wed Jun 04 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16.1 - Bumped release and rebuilt Fri May 23 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16 - Fixed ether-wake usage output (#55801). Thu May 22 2003 Jeremy Katz <katzj@redhat.com> 1.60-15 - fix build with gcc 3.3 Thu May 22 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-14 - Fixed wrong manpage (#55473). Wed May 21 2003 Phil Knirsch <pknirsch@redhat.com> - Added inet6-lookup patch from John van Krieken (#84108). - Fixed outdated link in ifconfig manpage (#91287). Tue May 20 2003 Phil Knirsch <pknirsch@redhat.com> - Fixed incorrect address display for ipx (#46434). - Fixed wrongly installed manpage dirs (#50664). Wed Mar 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-13 - Fixed nameif problem (#85748).
2004-09-09 09:10:51 +00:00
-
- if (inet_pton(AF_INET6, bufp, sin6->sin6_addr.s6_addr) <= 0)
- return (-1);
2011-12-06 18:15:09 +00:00
- p = fix_v4_address(bufp, &sin6->sin6_addr);
- if (p != bufp)
- memcpy(bufp, p, strlen(p)+1);
auto-import changelog data from net-tools-1.60-20.1.src.rpm Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20.1 -rebuilt Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20 - interface option now works as described in the man page (#61113). Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19.1 - rebuilt Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19 - Fixed trailing blank bug in hostname output (#101263). - Remove -O2 fir alpha (#78955). - Updated netstat statistic output, was still broken. Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18.1 - rebuilt Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18 - fix ether-wake.c build with gcc 3.3 - rebuilt Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> - rebuilt Wed Jun 04 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16.1 - Bumped release and rebuilt Fri May 23 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16 - Fixed ether-wake usage output (#55801). Thu May 22 2003 Jeremy Katz <katzj@redhat.com> 1.60-15 - fix build with gcc 3.3 Thu May 22 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-14 - Fixed wrong manpage (#55473). Wed May 21 2003 Phil Knirsch <pknirsch@redhat.com> - Added inet6-lookup patch from John van Krieken (#84108). - Fixed outdated link in ifconfig manpage (#91287). Tue May 20 2003 Phil Knirsch <pknirsch@redhat.com> - Fixed incorrect address display for ipx (#46434). - Fixed wrongly installed manpage dirs (#50664). Wed Mar 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-13 - Fixed nameif problem (#85748).
2004-09-09 09:10:51 +00:00
- return 16; /* ?;) */
-}
-
static int INET6_input(int type, char *bufp, struct sockaddr *sap)
{
- switch (type) {
- case 1:
- return (INET6_getsock(bufp, sap));
- default:
- return (INET6_resolve(bufp, (struct sockaddr_in6 *) sap));
- }
+ return (INET6_resolve(bufp, (struct sockaddr_in6 *) sap));
}
2011-12-06 18:15:09 +00:00
diff -up net-tools-1.60/lib/inet6_gr.c.inet6-lookup net-tools-1.60/lib/inet6_gr.c
--- net-tools-1.60/lib/inet6_gr.c.inet6-lookup 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/inet6_gr.c 2011-12-01 17:11:21.958445708 +0100
@@ -108,7 +108,7 @@ int rprint_fib6(int ext, int numeric)
auto-import changelog data from net-tools-1.60-20.1.src.rpm Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20.1 -rebuilt Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20 - interface option now works as described in the man page (#61113). Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19.1 - rebuilt Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19 - Fixed trailing blank bug in hostname output (#101263). - Remove -O2 fir alpha (#78955). - Updated netstat statistic output, was still broken. Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18.1 - rebuilt Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18 - fix ether-wake.c build with gcc 3.3 - rebuilt Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> - rebuilt Wed Jun 04 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16.1 - Bumped release and rebuilt Fri May 23 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16 - Fixed ether-wake usage output (#55801). Thu May 22 2003 Jeremy Katz <katzj@redhat.com> 1.60-15 - fix build with gcc 3.3 Thu May 22 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-14 - Fixed wrong manpage (#55473). Wed May 21 2003 Phil Knirsch <pknirsch@redhat.com> - Added inet6-lookup patch from John van Krieken (#84108). - Fixed outdated link in ifconfig manpage (#91287). Tue May 20 2003 Phil Knirsch <pknirsch@redhat.com> - Fixed incorrect address display for ipx (#46434). - Fixed wrongly installed manpage dirs (#50664). Wed Mar 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-13 - Fixed nameif problem (#85748).
2004-09-09 09:10:51 +00:00
addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
inet6_aftype.input(1, addr6, (struct sockaddr *) &saddr6);
snprintf(addr6, sizeof(addr6), "%s/%d",
- inet6_aftype.sprint((struct sockaddr *) &saddr6, 1),
+ inet6_aftype.sprint((struct sockaddr *) &saddr6, numeric),
prefix_len);
/* Fetch and resolve the nexthop address. */
2011-12-06 18:15:09 +00:00
@@ -117,7 +117,7 @@ int rprint_fib6(int ext, int numeric)
auto-import changelog data from net-tools-1.60-20.1.src.rpm Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20.1 -rebuilt Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20 - interface option now works as described in the man page (#61113). Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19.1 - rebuilt Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19 - Fixed trailing blank bug in hostname output (#101263). - Remove -O2 fir alpha (#78955). - Updated netstat statistic output, was still broken. Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18.1 - rebuilt Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18 - fix ether-wake.c build with gcc 3.3 - rebuilt Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> - rebuilt Wed Jun 04 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16.1 - Bumped release and rebuilt Fri May 23 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16 - Fixed ether-wake usage output (#55801). Thu May 22 2003 Jeremy Katz <katzj@redhat.com> 1.60-15 - fix build with gcc 3.3 Thu May 22 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-14 - Fixed wrong manpage (#55473). Wed May 21 2003 Phil Knirsch <pknirsch@redhat.com> - Added inet6-lookup patch from John van Krieken (#84108). - Fixed outdated link in ifconfig manpage (#91287). Tue May 20 2003 Phil Knirsch <pknirsch@redhat.com> - Fixed incorrect address display for ipx (#46434). - Fixed wrongly installed manpage dirs (#50664). Wed Mar 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-13 - Fixed nameif problem (#85748).
2004-09-09 09:10:51 +00:00
naddr6p[4], naddr6p[5], naddr6p[6], naddr6p[7]);
inet6_aftype.input(1, naddr6, (struct sockaddr *) &snaddr6);
snprintf(naddr6, sizeof(naddr6), "%s",
- inet6_aftype.sprint((struct sockaddr *) &snaddr6, 1));
+ inet6_aftype.sprint((struct sockaddr *) &snaddr6, numeric));
/* Decode the flags. */
2011-12-06 18:15:09 +00:00
diff -up net-tools-1.60/lib/inet6_sr.c.inet6-lookup net-tools-1.60/lib/inet6_sr.c
--- net-tools-1.60/lib/inet6_sr.c.inet6-lookup 2011-11-21 02:31:57.000000000 +0100
+++ net-tools-1.60/lib/inet6_sr.c 2011-12-01 17:14:32.707061021 +0100
@@ -32,6 +32,7 @@
#include "net-support.h"
#include "pathnames.h"
#include "intl.h"
+#include "util.h"
#include "net-features.h"
2011-12-06 18:15:09 +00:00
@@ -63,7 +64,7 @@ static int INET6_setroute(int action, in
auto-import changelog data from net-tools-1.60-20.1.src.rpm Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20.1 -rebuilt Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20 - interface option now works as described in the man page (#61113). Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19.1 - rebuilt Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19 - Fixed trailing blank bug in hostname output (#101263). - Remove -O2 fir alpha (#78955). - Updated netstat statistic output, was still broken. Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18.1 - rebuilt Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18 - fix ether-wake.c build with gcc 3.3 - rebuilt Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> - rebuilt Wed Jun 04 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16.1 - Bumped release and rebuilt Fri May 23 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16 - Fixed ether-wake usage output (#55801). Thu May 22 2003 Jeremy Katz <katzj@redhat.com> 1.60-15 - fix build with gcc 3.3 Thu May 22 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-14 - Fixed wrong manpage (#55473). Wed May 21 2003 Phil Knirsch <pknirsch@redhat.com> - Added inet6-lookup patch from John van Krieken (#84108). - Fixed outdated link in ifconfig manpage (#91287). Tue May 20 2003 Phil Knirsch <pknirsch@redhat.com> - Fixed incorrect address display for ipx (#46434). - Fixed wrongly installed manpage dirs (#50664). Wed Mar 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-13 - Fixed nameif problem (#85748).
2004-09-09 09:10:51 +00:00
if (*args == NULL)
return (usage());
- strcpy(target, *args++);
+ safe_strncpy(target, *args++, sizeof(target));
if (!strcmp(target, "default")) {
prefix_len = 0;
memset(&sa6, 0, sizeof(sa6));
2011-12-06 18:15:09 +00:00
@@ -112,7 +113,7 @@ static int INET6_setroute(int action, in
auto-import changelog data from net-tools-1.60-20.1.src.rpm Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20.1 -rebuilt Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20 - interface option now works as described in the man page (#61113). Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19.1 - rebuilt Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19 - Fixed trailing blank bug in hostname output (#101263). - Remove -O2 fir alpha (#78955). - Updated netstat statistic output, was still broken. Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18.1 - rebuilt Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18 - fix ether-wake.c build with gcc 3.3 - rebuilt Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> - rebuilt Wed Jun 04 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16.1 - Bumped release and rebuilt Fri May 23 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16 - Fixed ether-wake usage output (#55801). Thu May 22 2003 Jeremy Katz <katzj@redhat.com> 1.60-15 - fix build with gcc 3.3 Thu May 22 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-14 - Fixed wrong manpage (#55473). Wed May 21 2003 Phil Knirsch <pknirsch@redhat.com> - Added inet6-lookup patch from John van Krieken (#84108). - Fixed outdated link in ifconfig manpage (#91287). Tue May 20 2003 Phil Knirsch <pknirsch@redhat.com> - Fixed incorrect address display for ipx (#46434). - Fixed wrongly installed manpage dirs (#50664). Wed Mar 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-13 - Fixed nameif problem (#85748).
2004-09-09 09:10:51 +00:00
return (usage());
if (rt.rtmsg_flags & RTF_GATEWAY)
return (usage());
- strcpy(gateway, *args);
+ safe_strncpy(gateway, *args, sizeof(gateway));
if (inet6_aftype.input(1, gateway,
(struct sockaddr *) &sa6) < 0) {
inet6_aftype.herror(gateway);
2011-12-06 18:15:09 +00:00
@@ -152,7 +153,7 @@ static int INET6_setroute(int action, in
auto-import changelog data from net-tools-1.60-20.1.src.rpm Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20.1 -rebuilt Mon Aug 25 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-20 - interface option now works as described in the man page (#61113). Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19.1 - rebuilt Tue Aug 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-19 - Fixed trailing blank bug in hostname output (#101263). - Remove -O2 fir alpha (#78955). - Updated netstat statistic output, was still broken. Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18.1 - rebuilt Tue Jun 17 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-18 - fix ether-wake.c build with gcc 3.3 - rebuilt Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> - rebuilt Wed Jun 04 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16.1 - Bumped release and rebuilt Fri May 23 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-16 - Fixed ether-wake usage output (#55801). Thu May 22 2003 Jeremy Katz <katzj@redhat.com> 1.60-15 - fix build with gcc 3.3 Thu May 22 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-14 - Fixed wrong manpage (#55473). Wed May 21 2003 Phil Knirsch <pknirsch@redhat.com> - Added inet6-lookup patch from John van Krieken (#84108). - Fixed outdated link in ifconfig manpage (#91287). Tue May 20 2003 Phil Knirsch <pknirsch@redhat.com> - Fixed incorrect address display for ipx (#46434). - Fixed wrongly installed manpage dirs (#50664). Wed Mar 19 2003 Phil Knirsch <pknirsch@redhat.com> 1.60-13 - Fixed nameif problem (#85748).
2004-09-09 09:10:51 +00:00
}
if (devname) {
memset(&ifr, 0, sizeof(ifr));
- strcpy(ifr.ifr_name, devname);
+ safe_strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name));
if (ioctl(skfd, SIOGIFINDEX, &ifr) < 0) {
perror("SIOGIFINDEX");