FreeBSD Bugzilla – Attachment 212811 Details for
Bug 245148
ifconfig(8) tunnel destination not respecting CLI specified address_family
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proof of concept to pass getaddrinfo(3) hints
sbin-ifconfig-ifconfig.c_getaddrinfo_hints.patch (text/plain), 1013 bytes, created by
Jason Unovitch
on 2020-03-28 19:17:47 UTC
(
hide
)
Description:
Proof of concept to pass getaddrinfo(3) hints
Filename:
MIME Type:
Creator:
Jason Unovitch
Created:
2020-03-28 19:17:47 UTC
Size:
1013 bytes
patch
obsolete
>diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c >index c324050aad8..e6dde563940 100644 >--- a/sbin/ifconfig/ifconfig.c >+++ b/sbin/ifconfig/ifconfig.c >@@ -966,9 +966,12 @@ setifaddr(const char *addr, int param, int s, const struct afswtch *afp) > static void > settunnel(const char *src, const char *dst, int s, const struct afswtch *afp) > { >- struct addrinfo *srcres, *dstres; >+ struct addrinfo hints, *srcres, *dstres; > int ecode; > >+ memset(&hints, 0, sizeof(hints)); >+ hints.ai_family = afp->af_af; >+ > if (afp->af_settunnel == NULL) { > warn("address family %s does not support tunnel setup", > afp->af_name); >@@ -979,7 +982,7 @@ settunnel(const char *src, const char *dst, int s, const struct afswtch *afp) > errx(1, "error in parsing address string: %s", > gai_strerror(ecode)); > >- if ((ecode = getaddrinfo(dst, NULL, NULL, &dstres)) != 0) >+ if ((ecode = getaddrinfo(dst, NULL, &hints, &dstres)) != 0) > errx(1, "error in parsing address string: %s", > gai_strerror(ecode)); >
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 245148
: 212811