File mipv6-2.0.2-umip-0.4.diff of Package mipv6d

--- libnetlink/libnetlink.c
+++ libnetlink/libnetlink.c	2017/12/12 07:27:13
@@ -56,7 +56,7 @@ int rtnl_open_byproto(struct rtnl_handle
 	int sndbuf = SO_SNDBUF_SIZE;
 	int rcvbuf = SO_RCVBUF_SIZE;
 
-	memset(rth, 0, sizeof(rth));
+	memset(rth, 0, sizeof(*rth));
 
 	rth->fd = socket(AF_NETLINK, SOCK_RAW, protocol);
 	if (rth->fd < 0) {
--- src/bul.c
+++ src/bul.c	2017/12/12 07:33:43
@@ -273,8 +273,9 @@ int bul_home_init(struct home_addr_info
 /* bule_cleanup - cleans up a bulentry */
 static int bule_cleanup(void *vbule, void *vbul)
 {
-	if (vbul == NULL)
+	if (vbul == NULL) {
 		BUG("bul_hash should be empty!\n");
+	}
 	bul_delete(vbule);
 	return 0;
 }
--- src/conf.c
+++ src/conf.c	2017/12/12 07:28:23
@@ -275,8 +275,9 @@ void conf_show(struct mip6_config *c)
 	dbg("debug_level = %u\n", c->debug_level);
 	dbg("debug_log_file = %s\n", (c->debug_log_file ? c->debug_log_file :
 				      "stderr"));
-	if (c->pmgr.so_path)
+	if (c->pmgr.so_path) {
 		dbg("PolicyModulePath = %s\n", c->pmgr.so_path);
+	}
 	dbg("DefaultBindingAclPolicy = %u\n", c->DefaultBindingAclPolicy);
 	dbg("NonVolatileBindingCache = %s\n",
 	    CONF_BOOL_STR(c->NonVolatileBindingCache));
@@ -296,8 +297,9 @@ void conf_show(struct mip6_config *c)
 	    tstodsec(c->InitialBindackTimeoutFirstReg_ts));
 	dbg("InitialBindackTimeoutReReg = %f\n", 
 	    tstodsec(c->InitialBindackTimeoutReReg_ts));
-	if (c->MoveModulePath)
+	if (c->MoveModulePath) {
 		dbg("MoveModulePath = %s\n", c->MoveModulePath);
+	}
 	dbg("UseCnBuAck = %s\n", CONF_BOOL_STR(c->CnBuAck));
 	dbg("DoRouteOptimizationMN = %s\n",
 	    CONF_BOOL_STR(c->DoRouteOptimizationMN));
--- src/icmp6.c
+++ src/icmp6.c	2017/12/12 07:29:41
@@ -343,8 +343,9 @@ int icmp6_send(int oif, uint8_t hoplimit
 		   &hops, sizeof(hops));
 
 	ret = sendmsg(icmp6_sock.fd, &msg, 0);
-	if (ret < 0)
+	if (ret < 0) {
 		dbg("sendmsg: %s\n", strerror(errno));
+	}
 
 	pthread_mutex_unlock(&icmp6_sock.send_mutex);
 
--- src/ipsec.c
+++ src/ipsec.c	2017/12/12 07:38:03
@@ -328,8 +328,9 @@ static int xfrm_sendmigrate(struct xfrm_
 #endif
 
 	err = rtnl_xfrm_do(&req.n, NULL);
-	if (err < 0)
+	if (err < 0) {
 		dbg("err = %d (%s)\n", err, strerror(-err));
+	}
 
 	return ((err == 0 || err == -ENOENT) ? 0 : -1);
 }
@@ -411,10 +412,12 @@ static void dump_migrate(int ifindex,
 	dbg("ifindex\t%d\n", ifindex);
 	dbg("hoa\t%x:%x:%x:%x:%x:%x:%x:%x\n", NIP6ADDR(hoa));
 	dbg("ha\t%x:%x:%x:%x:%x:%x:%x:%x\n", NIP6ADDR(haaddr));
-	if (oldcoa)
+	if (oldcoa) {
 		dbg("ocoa\t%x:%x:%x:%x:%x:%x:%x:%x\n", NIP6ADDR(oldcoa));
-	if (newcoa)
+	}
+	if (newcoa) {
 		dbg("ncoa\t%x:%x:%x:%x:%x:%x:%x:%x\n", NIP6ADDR(newcoa));
+	}
 	dbg("ipsec\t%s\n",
 	    (ipsec_proto == IPPROTO_ESP) ? "ESP" :
 	    (ipsec_proto == IPPROTO_AH) ? "AH" :
--- src/main.c
+++ src/main.c	2017/12/12 07:28:48
@@ -28,6 +28,8 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+#include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <sys/wait.h>
 #include <sys/param.h>
--- src/mh.c
+++ src/mh.c	2017/12/12 07:32:09
@@ -617,13 +617,14 @@ int mh_send(const struct in6_addr_bundle
 	     "to %x:%x:%x:%x:%x:%x:%x:%x\n",
 	     mh->ip6mh_type, NIP6ADDR(addrs->src), NIP6ADDR(addrs->dst));
 	    
-	if (addrs->local_coa)
+	if (addrs->local_coa) {
 		MDBG("local CoA %x:%x:%x:%x:%x:%x:%x:%x\n",
 		     NIP6ADDR(addrs->local_coa));
-
-	if (addrs->remote_coa)
+	}
+	if (addrs->remote_coa) {
 		MDBG("remote CoA %x:%x:%x:%x:%x:%x:%x:%x\n",
 		     NIP6ADDR(addrs->remote_coa));
+	}
 
 	if (bind_key) {
 		assert(iov_count > 1); 
@@ -721,8 +722,9 @@ int mh_send(const struct in6_addr_bundle
 	setsockopt(mh_sock.fd, IPPROTO_IPV6, IPV6_PKTINFO,
 		   &on, sizeof(int));
 	ret = sendmsg(mh_sock.fd, &msg, 0);
-	if (ret < 0)
+	if (ret < 0) {
 		dbg("sendmsg: %s\n", strerror(errno));
+	}
 
 	pthread_mutex_unlock(&mh_sock.send_mutex);
 
--- src/mn.c
+++ src/mn.c	2017/12/12 07:33:09
@@ -317,7 +317,7 @@ static int mn_send_bu_msg(struct bulentr
 	uint8_t *bind_key = NULL;
 	struct in6_addr_bundle addrs;
 
-	memset(iov, 0, IP6_MHOPT_MAX+1);
+	memset(iov, 0, sizeof(iov));
 	bu = mh_create(&iov[iov_ind++], IP6_MH_TYPE_BU);
 	if (!bu)
 		return -ENOMEM;
@@ -360,8 +360,9 @@ static int mn_send_bu_msg(struct bulentr
 
 	ret = mh_send(&addrs, iov, iov_ind, bind_key, bule->if_coa);
 
-	if (ret <= 0)
+	if (ret <= 0) {
 		MDBG("mh_send failed  ret: %d\n", ret);
+	}
 
 	free_iov_data(iov, iov_ind);
 	statistics_inc(&mipl_stat, MIPL_STATISTICS_OUT_BU);
@@ -756,11 +757,11 @@ static int process_first_home_bu(struct
 
 	hai->home_reg_status = HOME_REG_UNCERTAIN;
 
-	if ((err = mn_tnl_state_add(hai, hai->if_tunnel, 0)) < 0)
+	if ((err = mn_tnl_state_add(hai, hai->if_tunnel, 0)) < 0) {
 		MDBG("Failed to initialize new bule for HA\n");
-	else
+	} else {
 		MDBG("New bule for HA\n");
-
+	}
 	return err;
 }
 
--- src/ndisc.c
+++ src/ndisc.c	2017/12/12 07:30:34
@@ -490,8 +490,9 @@ static int ndisc_send_unspec(int oif, co
 	msgh.msg_controllen = cmsg->cmsg_len;
 
 	ret = sendmsg(fd, &msgh, 0);
-	if (ret < 0)
+	if (ret < 0) {
 		dbg("sendmsg: %s\n", strerror(errno));
+	}
 
 	close(fd);
 	type = hdr[0];
--- src/tunnelctl.c
+++ src/tunnelctl.c	2017/12/12 07:34:33
@@ -163,8 +163,9 @@ static int __tunnel_del(struct mip6_tnl
 			TDBG("SIOCDELTUNNEL failed status %d %s\n", 
 			     errno, strerror(errno));
 			res = -1;
-		} else
+		} else {
 			TDBG("tunnel deleted\n");
+		}
 		free(tnl);
 	}
 	return res;
@@ -196,8 +197,9 @@ int tunnel_del(int ifindex,
 		    ext_tunnel_ops(SIOCDELTUNNEL, tnl->ifindex, 0, data) < 0)
 			TDBG("ext_tunnel_ops failed\n");
 
-		if ((res = __tunnel_del(tnl)) < 0)
+		if ((res = __tunnel_del(tnl)) < 0) {
 			TDBG("tunnel %d deletion failed\n", ifindex);
+		}
 	}
 	pthread_mutex_unlock(&tnl_lock);
 	return res;
--- src/xfrm.c
+++ src/xfrm.c	2017/12/12 07:36:47
@@ -1931,8 +1931,9 @@ int xfrm_post_ba_mod_bule(struct bulentr
 	create_dstopt_tmpl(&tmpls[0], &bule->peer_addr, &bule->hoa);
 	ret = xfrm_mip_policy_add(&sel, 1, XFRM_POLICY_OUT,
 				   XFRM_POLICY_ALLOW, prio, tmpls, 1);
-	if (ret)
+	if (ret) {
 		XDBG("failed to insert outbound policy\n");
+	}
 
 	/* XXX: inbound is missed??? */
 	create_rh_tmpl(&tmpls[0]);
@@ -1940,8 +1941,9 @@ int xfrm_post_ba_mod_bule(struct bulentr
 		     0, &sel);
 	ret = xfrm_mip_policy_add(&sel, 1, XFRM_POLICY_IN,
 				   XFRM_POLICY_ALLOW, prio, tmpls, 1);
-	if (ret)
+	if (ret) {
 		XDBG("failed to insert inbound policy\n");
+	}
 
 	return ret;
 }
openSUSE Build Service is sponsored by