]> git.ipfire.org Git - people/ms/mstpd.git/commitdiff
Make sparse (mostly) happy
authorVitalii Demianets <vitas@nppfactor.kiev.ua>
Fri, 23 Sep 2011 10:03:32 +0000 (10:03 +0000)
committerVitalii Demianets <vitas@nppfactor.kiev.ua>
Fri, 23 Sep 2011 10:03:32 +0000 (10:03 +0000)
git-svn-id: http://svn.code.sf.net/p/mstpd/code/trunk@3 fbe50366-0c72-4402-a84b-5d246361dba7

bridge_track.c
ctl_main.c
mstp.c
netif_utils.c
packet.c

index ba261ca478420f8020bf38cc879c9ba0a646b247..044fea195cbf1bdb0599bcf77a1ec8c178b441b7 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/byteorder.h>
 
 #include "bridge_ctl.h"
+#include "ctl_functions.h"
 #include "netif_utils.h"
 #include "packet.h"
 #include "log.h"
index 863e9a816355a879cabf62e42fcf9fff38f81d62..d4b3e6095c2a8089470cb380f6c4b047e0248680 100644 (file)
@@ -1010,7 +1010,7 @@ static void command_helpall(void)
     }
 }
 
-static void help()
+static void help(void)
 {
     printf("Usage: mstpctl [commands]\n");
     printf("commands:\n");
diff --git a/mstp.c b/mstp.c
index 0ab4886d4973c87cb14c9e52730695a5acfff702..b8f90af61bb1e3d5d582484d8c287a0189286ba4 100644 (file)
--- a/mstp.c
+++ b/mstp.c
@@ -1583,7 +1583,7 @@ static port_info_t rcvInfo(per_tree_port_t *ptp)
             /* 13.26.6.NOTE: A Configuration BPDU implicitly conveys a
              *   Designated Port Role */
             roleIsDesignated = true;
-            assign(mPri->IntRootPathCost, 0u);
+            assign(mPri->IntRootPathCost, __constant_cpu_to_be32(0));
             assign(mPri->DesignatedBridgeID, b->cistRRootID);
             /* messageTimes.remainingHops */
             assign(mTimes->remainingHops, prt->bridge->MaxHops);
index da26a6f4b6decf169ce432dcd4fc5dab5fc80db7..2ca251e82f22cf8889c31717df3cd00b0a84447a 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "log.h"
 
-int netsock = -1;
+static int netsock = -1;
 
 int netsock_init(void)
 {
index 0c08ae7301ad1fdecd604ba0e6d2c0c340974cf2..c1d4ff54410d96a94744cc79f00579a26aa0e2be 100644 (file)
--- a/packet.c
+++ b/packet.c
@@ -32,6 +32,7 @@
 #include <netinet/in.h>
 #include <linux/if_packet.h>
 #include <linux/filter.h>
+#include <asm/byteorder.h>
 
 #include "epoll_loop.h"
 #include "netif_utils.h"
@@ -66,7 +67,7 @@ void packet_send(int ifindex, const struct iovec *iov, int iov_count, int len)
     struct sockaddr_ll sl =
     {
         .sll_family = AF_PACKET,
-        .sll_protocol = htons(ETH_P_802_2),
+        .sll_protocol = __constant_cpu_to_be16(ETH_P_802_2),
         .sll_ifindex = ifindex,
         .sll_halen = ETH_ALEN,
     };