chiark / gitweb /
Revert back to /var/run at a couple of problems
[elogind.git] / src / libsystemd / sd-rtnl / rtnl-message.c
index 5d4dc718101aae05000ee38b1262993e13b63200..27b606593b072cde49f719d17562ce6bce44ae6a 100644 (file)
@@ -85,9 +85,8 @@ int sd_rtnl_message_route_set_dst_prefixlen(sd_rtnl_message *m, unsigned char pr
         return 0;
 }
 
-int sd_rtnl_message_new_route(sd_rtnl *rtnl, uint16_t nlmsg_type,
-                              unsigned char rtm_family,
-                              sd_rtnl_message **ret) {
+int sd_rtnl_message_new_route(sd_rtnl *rtnl, sd_rtnl_message **ret,
+                              uint16_t nlmsg_type, unsigned char rtm_family) {
         struct rtmsg *rtm;
         int r;
 
@@ -147,8 +146,8 @@ int sd_rtnl_message_link_set_type(sd_rtnl_message *m, unsigned type) {
         return 0;
 }
 
-int sd_rtnl_message_new_link(sd_rtnl *rtnl, uint16_t nlmsg_type, int index,
-                             sd_rtnl_message **ret) {
+int sd_rtnl_message_new_link(sd_rtnl *rtnl, sd_rtnl_message **ret,
+                             uint16_t nlmsg_type, int index) {
         struct ifinfomsg *ifi;
         int r;
 
@@ -222,9 +221,9 @@ int sd_rtnl_message_addr_set_scope(sd_rtnl_message *m, unsigned char scope) {
         return 0;
 }
 
-int sd_rtnl_message_new_addr(sd_rtnl *rtnl, uint16_t nlmsg_type, int index,
-                             unsigned char family,
-                             sd_rtnl_message **ret) {
+int sd_rtnl_message_new_addr(sd_rtnl *rtnl, sd_rtnl_message **ret,
+                             uint16_t nlmsg_type, int index,
+                             unsigned char family) {
         struct ifaddrmsg *ifa;
         int r;
 
@@ -481,7 +480,7 @@ int sd_rtnl_message_append_u16(sd_rtnl_message *m, unsigned short type, uint16_t
                                 break;
                         else
                                 return -ENOTSUP;
-                        break;
+
                 default:
                         return -ENOTSUP;
         }
@@ -522,6 +521,7 @@ int sd_rtnl_message_append_u32(sd_rtnl_message *m, unsigned short type, uint32_t
                                 case IFLA_PROMISCUITY:
                                 case IFLA_NUM_TX_QUEUES:
                                 case IFLA_NUM_RX_QUEUES:
+                                case IFLA_MACVLAN_MODE:
                                         break;
                                 default:
                                         return -ENOTSUP;
@@ -933,10 +933,6 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
 
         if (k > 0)
                 switch (m->hdr->nlmsg_type) {
-                        struct ifinfomsg *ifi;
-                        struct ifaddrmsg *ifa;
-                        struct rtmsg *rtm;
-
                         /* check that the size matches the message type */
                         case NLMSG_ERROR:
                                 if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr)))
@@ -949,6 +945,8 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
                                 if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifinfomsg)))
                                         k = -EIO;
                                 else {
+                                        struct ifinfomsg *ifi;
+
                                         ifi = NLMSG_DATA(m->hdr);
                                         UPDATE_RTA(m, IFLA_RTA(ifi));
                                 }
@@ -959,6 +957,8 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
                                 if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifaddrmsg)))
                                         k = -EIO;
                                 else {
+                                        struct ifaddrmsg *ifa;
+
                                         ifa = NLMSG_DATA(m->hdr);
                                         UPDATE_RTA(m, IFA_RTA(ifa));
                                 }
@@ -969,6 +969,8 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
                                 if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct rtmsg)))
                                         k = -EIO;
                                 else {
+                                        struct rtmsg *rtm;
+
                                         rtm = NLMSG_DATA(m->hdr);
                                         UPDATE_RTA(m, RTM_RTA(rtm));
                                 }