View | Details | Raw Unified | Return to bug 226982 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-1 / +1 lines)
Lines 2-8 Link Here
2
2
3
PORTNAME=	isboot-kmod
3
PORTNAME=	isboot-kmod
4
PORTVERSION=	0.2.13
4
PORTVERSION=	0.2.13
5
PORTREVISION=	1
5
PORTREVISION=	2
6
CATEGORIES=	net
6
CATEGORIES=	net
7
MASTER_SITES=	http://www.peach.ne.jp/archives/isboot/
7
MASTER_SITES=	http://www.peach.ne.jp/archives/isboot/
8
DISTNAME=	isboot-${PORTVERSION}
8
DISTNAME=	isboot-${PORTVERSION}
(-)files/patch-Makefile (+10 lines)
Line 0 Link Here
1
--- Makefile.orig	2015-09-24 04:33:04 UTC
2
+++ Makefile
3
@@ -6,6 +6,7 @@ KMOD=	isboot
4
 SRCS=	isboot.c ibft.c iscsi.c
5
 SRCS+=	isboot.h ibft.h iscsi_compat.h
6
 SRCS+=	opt_cam.h
7
+SRCS+=  device_if.h bus_if.h
8
 #CFLAGS+= -DVIMAGE
9
 #CFLAGS+= -DIBFT_VERBOSE
10
 #CFLAGS+= -DDEBUG
(-)files/patch-isboot.c (-4 / +55 lines)
Lines 1-6 Link Here
1
--- isboot.c.orig	2015-11-05 16:50:51 UTC
1
--- isboot.c.orig	2015-11-05 16:50:51 UTC
2
+++ isboot.c
2
+++ isboot.c
3
@@ -347,9 +347,9 @@ isboot_set_v4gw(struct sockaddr_in *gate
3
@@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
4
 
5
 #include <sys/param.h>
6
 #include <sys/kernel.h>
7
+#include <sys/proc.h>
8
 #include <sys/module.h>
9
 #include <sys/endian.h>
10
 #include <sys/systm.h>
11
@@ -347,9 +348,9 @@ isboot_set_v4gw(struct sockaddr_in *gateway)
4
 	netmask.sin_addr.s_addr = htonl(0);
12
 	netmask.sin_addr.s_addr = htonl(0);
5
 
13
 
6
 	/* delete gateway if exists */
14
 	/* delete gateway if exists */
Lines 12-18 Link Here
12
 	if (error) {
20
 	if (error) {
13
 		if (error != ESRCH) {
21
 		if (error != ESRCH) {
14
 			printf("rtrequest RTM_DELETE error %d\n",
22
 			printf("rtrequest RTM_DELETE error %d\n",
15
@@ -359,9 +359,9 @@ isboot_set_v4gw(struct sockaddr_in *gate
23
@@ -359,9 +360,9 @@ isboot_set_v4gw(struct sockaddr_in *gateway)
16
 	}
24
 	}
17
 
25
 
18
 	/* set new default gateway */
26
 	/* set new default gateway */
Lines 24-30 Link Here
24
 	if (error) {
32
 	if (error) {
25
 		printf("rtrequest RTM_ADD error %d\n", error);
33
 		printf("rtrequest RTM_ADD error %d\n", error);
26
 		return (error);
34
 		return (error);
27
@@ -391,9 +391,9 @@ isboot_set_v6gw(struct sockaddr_in6 *gat
35
@@ -391,9 +392,9 @@ isboot_set_v6gw(struct sockaddr_in6 *gateway)
28
 	memset(&netmask.sin6_addr, 0, 16);
36
 	memset(&netmask.sin6_addr, 0, 16);
29
 
37
 
30
 	/* delete gateway if exists */
38
 	/* delete gateway if exists */
Lines 36-42 Link Here
36
 	if (error) {
44
 	if (error) {
37
 		if (error != ESRCH) {
45
 		if (error != ESRCH) {
38
 			printf("rtrequest RTM_DELETE error %d\n",
46
 			printf("rtrequest RTM_DELETE error %d\n",
39
@@ -403,9 +403,9 @@ isboot_set_v6gw(struct sockaddr_in6 *gat
47
@@ -403,9 +404,9 @@ isboot_set_v6gw(struct sockaddr_in6 *gateway)
40
 	}
48
 	}
41
 
49
 
42
 	/* set new default gateway */
50
 	/* set new default gateway */
Lines 48-50 Link Here
48
 	if (error) {
56
 	if (error) {
49
 		printf("rtrequest RTM_ADD error %d\n", error);
57
 		printf("rtrequest RTM_ADD error %d\n", error);
50
 		return (error);
58
 		return (error);
59
@@ -416,29 +417,36 @@ isboot_set_v6gw(struct sockaddr_in6 *gateway)
60
 static int
61
 isboot_ifup(struct ifnet *ifp)
62
 {
63
+	struct socket *so;
64
 	struct ifreq ifr;
65
 	struct thread *td;
66
 	int error;
67
 
68
-	memset(&ifr, 0, sizeof(ifr));
69
 	td = curthread;
70
+	error = socreate(AF_INET, &so, SOCK_DGRAM, 0, td->td_ucred, td);
71
+	if (error) {
72
+	    printf("%s: socreate, error=%d\n", __func__, error);
73
+	    return (error);
74
+	}
75
 
76
 	/* boot NIC */
77
+	memset(&ifr, 0, sizeof(ifr));
78
 	strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name));
79
 
80
 	/* set IFF_UP */
81
-	error = ifioctl(NULL, SIOCGIFFLAGS, (caddr_t)&ifr, td);
82
+	error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)&ifr, td);
83
 	if (error) {
84
-		printf("ifioctl SIOCGIFFLAGS\n");
85
+		printf("%s: ifioctl SIOCGIFFLAGS, error=%d\n", __func__, error);
86
 		return (error);
87
 	}
88
+
89
 	ifr.ifr_flags |= IFF_UP;
90
-	error = ifioctl(NULL, SIOCSIFFLAGS, (caddr_t)&ifr, td);
91
+	error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)&ifr, td);
92
 	if (error) {
93
-		printf("ifioctl SIOCSIFFLAGS\n");
94
+		printf("%s, ifioctl SIOCSIFFLAGS, error=%d\n", __func__, error);
95
 		return (error);
96
 	}
97
-
98
+	soclose(so);
99
 	return (0);
100
 }
101
 
(-)files/patch-iscsi.c (+48 lines)
Line 0 Link Here
1
--- iscsi.c.orig	2015-11-05 16:50:51 UTC
2
+++ iscsi.c
3
@@ -1070,26 +1070,25 @@ isboot_append_param(pdu_t *pp, char *format, ...)
4
 	return (n);
5
 }
6
 
7
-
8
-#if __FreeBSD_version >= 1100000
9
+#if __FreeBSD_version >= 1200051
10
 static void
11
+isboot_free_mbufext(struct mbuf *m)
12
+{
13
+       void *p = m->m_ext.ext_arg1;
14
+#elif __FreeBSD_version >= 1100000
15
+static void
16
 isboot_free_mbufext(struct mbuf *m, void *p, void *optarg)
17
+{
18
 #elif __FreeBSD_version >= 1000050 && __FreeBSD_version < 1100000
19
 static int
20
 isboot_free_mbufext(struct mbuf *m, void *p, void *optarg)
21
+{
22
 #else
23
 static void
24
 isboot_free_mbufext(void *p, void *optarg)
25
-#endif
26
 {
27
-
28
-	ISBOOT_TRACE("isboot_free_mbufext\n");
29
-	if (p == NULL)
30
-#if __FreeBSD_version >= 1000050 && __FreeBSD_version < 1100000
31
-		return (EXT_FREE_OK);
32
-#else
33
-		return;
34
 #endif
35
+	ISBOOT_TRACE("isboot_free_mbufext\n");
36
 	isboot_free_mext(p);
37
 #if __FreeBSD_version >= 1000050 && __FreeBSD_version < 1100000
38
 	return (EXT_FREE_OK);
39
@@ -1224,7 +1223,8 @@ isboot_recv_pdu(struct isboot_sess *sess, pdu_t *pp)
40
 		return (error);
41
 	}
42
 	if (uio.uio_resid != 0) {
43
-		ISBOOT_ERROR("soreceive BHS is not complete\n");
44
+		ISBOOT_ERROR("soreceive BHS is not complete, remaining "
45
+			"byte(s)=%d\n", (int) uio.uio_resid);
46
 		return (EIO);
47
 	}
48
 	m_copydata(mp, 0, ISCSI_BHS_LEN, (caddr_t)&pp->ipdu.bhs);

Return to bug 226982