FreeBSD Bugzilla – Attachment 183590 Details for
Bug 220078
[patch] [panic] repeatable kernel panic due to unlocked INADDR_TO_IFP usage
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch (untested)
ipfw_localip.diff (text/plain), 1.06 KB, created by
Andrey V. Elsukov
on 2017-06-18 06:09:19 UTC
(
hide
)
Description:
Proposed patch (untested)
Filename:
MIME Type:
Creator:
Andrey V. Elsukov
Created:
2017-06-18 06:09:19 UTC
Size:
1.06 KB
patch
obsolete
>Index: sys/netpfil/ipfw/ip_fw2.c >=================================================================== >--- sys/netpfil/ipfw/ip_fw2.c (revision 320065) >+++ sys/netpfil/ipfw/ip_fw2.c (working copy) >@@ -467,6 +467,19 @@ verify_path(struct in_addr src, struct ifnet *ifp, > #endif /* __FreeBSD__ */ > } > >+/* >+ * Return 1 if an internet address is configured on one of our interfaces. >+ */ >+static int >+ipfw_localip(struct in_addr addr) >+{ >+ >+ if (addr.s_addr == INADDR_BROADCAST || >+ addr.s_addr == INADDR_ANY) >+ return (0); >+ return (in_localip(addr)); >+} >+ > #ifdef INET6 > /* > * ipv6 specific rules here... >@@ -1602,10 +1615,7 @@ do { \ > > case O_IP_SRC_ME: > if (is_ipv4) { >- struct ifnet *tif; >- >- INADDR_TO_IFP(src_ip, tif); >- match = (tif != NULL); >+ match = ipfw_localip(src_ip); > break; > } > #ifdef INET6 >@@ -1641,10 +1651,7 @@ do { \ > > case O_IP_DST_ME: > if (is_ipv4) { >- struct ifnet *tif; >- >- INADDR_TO_IFP(dst_ip, tif); >- match = (tif != NULL); >+ match = ipfw_localip(dst_ip); > break; > } > #ifdef INET6
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 220078
:
183567
|
183568
|
183569
|
183570
| 183590 |
187688
|
187689