Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 161221 Details for
Bug 232889
Somewhat erroneous parsing of truncated "address/bits" IP range specification
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to extend shorthand ipaddress notations
iptables.patch (text/plain), 1.35 KB, created by
Neil Horman
on 2007-08-13 20:23:00 UTC
(
hide
)
Description:
patch to extend shorthand ipaddress notations
Filename:
MIME Type:
Creator:
Neil Horman
Created:
2007-08-13 20:23:00 UTC
Size:
1.35 KB
patch
obsolete
>--- iptables-1.2.11/iptables.c.orig 2007-08-13 14:04:14.000000000 -0400 >+++ iptables-1.2.11/iptables.c 2007-08-13 16:12:44.000000000 -0400 >@@ -573,6 +573,50 @@ > return (char *) NULL; > } > >+static void extend_dotted(const char *in, char *out, size_t outsz) >+{ >+ const char *i; >+ char *o; >+ int dotcount, dotleft; >+ char nexto = '.'; >+ >+ memset(out, 0x0, outsz); >+ i = in; >+ o = out; >+ dotcount = 0; >+ while(*i != '\0') { >+ if (*i == '.') { >+ dotcount++; >+ nexto = '0'; >+ } else >+ nexto = '.'; >+ >+ *o=*i; >+ o++; >+ i++; >+ } >+ >+ dotleft = 3 - dotcount; >+ >+ while(dotleft) { >+ *o = nexto; >+ if (nexto == '.') { >+ nexto = '0'; >+ dotleft--; >+ } else >+ nexto = '.'; >+ o++; >+ } >+ >+ /* >+ * Fill in the last zero if we need it >+ */ >+ if (nexto == '0') >+ *o = '0'; >+ >+ return; >+} >+ > /* > * All functions starting with "parse" should succeed, otherwise > * the program fails. >@@ -586,9 +630,12 @@ > parse_hostnetwork(const char *name, unsigned int *naddrs) > { > struct in_addr *addrp, *addrptmp; >+ char ext_name[20]; >+ >+ extend_dotted(name, ext_name, 20); > >- if ((addrptmp = dotted_to_addr(name)) != NULL || >- (addrptmp = network_to_addr(name)) != NULL) { >+ if ((addrptmp = dotted_to_addr(ext_name)) != NULL || >+ (addrptmp = network_to_addr(ext_name)) != NULL) { > addrp = fw_malloc(sizeof(struct in_addr)); > inaddrcpy(addrp, addrptmp); > *naddrs = 1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 232889
: 161221