Post by John Nielsen[ resending from correct email address ]
Post by Maurizio VairaniI am running
# uname
-a
FreeBSD 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328383: Thu Jan 25 04:48:52
amd64
https://lists.freebsd.org/pipermail/freebsd-current/2018-January/068272.html
I can boot FreeBSD via iSCSI using iPXE. But when the isboot, the iSCSI
https://mega.nz/#!tkVwBBKA!PUj14-Za6KCNaoo9hxuXORRLQoWkb4LMvTdUA1BorD4
Any idea?
Bummer!
Aoyama-san-
Are you still maintaining isboot? Can you help debug this issue on FreeBSD 12-CURRENT?
Once we get it working I will update the port with whatever is needed and send you the patches in case you'd like to cut a new release.
Thank you!
I have solved the issue changing the function isboot_ifup() in the source file isboot.c.
Here is a patch with some changes to minimize the diff. Except for the printed error messages does that look functionally equivalent?
Now the question is why is this change needed and for what values of __FreeBSD_version is it appropriate?
# diff -u isboot.c.patched1 isboot.c
--- isboot.c.patched1 2018-02-06 10:35:20.808692000 -0700
+++ isboot.c 2018-02-06 10:50:05.347663000 -0700
@@ -417,28 +417,36 @@
isboot_ifup(struct ifnet *ifp)
{
struct ifreq ifr;
+ struct socket *so;
struct thread *td;
int error;
memset(&ifr, 0, sizeof(ifr));
td = curthread;
+ error = socreate(AF_INET, &so, SOCK_DGRAM, 0, td->td_ucred, td);
+ if (error) {
+ printf("%s: socreate, error=%d\n", __func__, error);
+ return (error);
+ }
+
/* boot NIC */
strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name));
/* set IFF_UP */
- error = ifioctl(NULL, SIOCGIFFLAGS, (caddr_t)&ifr, td);
+ error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)&ifr, td);
if (error) {
printf("ifioctl SIOCGIFFLAGS\n");
return (error);
}
ifr.ifr_flags |= IFF_UP;
- error = ifioctl(NULL, SIOCSIFFLAGS, (caddr_t)&ifr, td);
+ error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)&ifr, td);
if (error) {
printf("ifioctl SIOCSIFFLAGS\n");
return (error);
}
+ soclose(so);
return (0);
}
Post by John Nielsenstatic int
isboot_ifup(struct ifnet *ifp)
{
struct socket *so;
struct ifreq ifr;
struct thread *td;
int error;
td = curthread;
error = socreate(AF_INET, &so, SOCK_DGRAM, 0, td->td_ucred, td);
if (error) {
printf("%s: socreate, error=%d\n", __func__, error);
return (error);
}
/* boot NIC */
memset(&ifr, 0, sizeof(ifr));
strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name));
/* set IFF_UP */
error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)&ifr, td);
if (error) {
printf("%s: ifioctl SIOCGIFFLAGS, error=%d\n", __func__, error);
return (error);
}
ifr.ifr_flags |= IFF_UP;
error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)&ifr, td);
if (error) {
printf("%s, ifioctl SIOCSIFFLAGS, error=%d\n", __func__, error);
return (error);
}
soclose(so);
return (0);
}
I have added a socket in the ifioctl() call as in the /usr/src/sys/nfs/bootp_subr.c source.
Please let me know if you prefer a patch.
--
Regards,
Maurizio