From 1c4a6088ed13c449db16191890b20d20574e6ac0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 18 Feb 2016 22:47:34 +0100 Subject: [PATCH] sd-netlink: fix ifi_iftype type The iftype is an unsigned short, and not just an unsigned. --- src/libsystemd/sd-netlink/rtnl-message.c | 2 +- src/network/networkctl.c | 8 ++++---- src/systemd/sd-netlink.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libsystemd/sd-netlink/rtnl-message.c b/src/libsystemd/sd-netlink/rtnl-message.c index 090552f5765..255526bf32d 100644 --- a/src/libsystemd/sd-netlink/rtnl-message.c +++ b/src/libsystemd/sd-netlink/rtnl-message.c @@ -616,7 +616,7 @@ int sd_rtnl_message_link_get_flags(sd_netlink_message *m, unsigned *flags) { return 0; } -int sd_rtnl_message_link_get_type(sd_netlink_message *m, unsigned *type) { +int sd_rtnl_message_link_get_type(sd_netlink_message *m, unsigned short *type) { struct ifinfomsg *ifi; assert_return(m, -EINVAL); diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 60724fce805..185bdaf2932 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -58,7 +58,7 @@ static void pager_open_if_enabled(void) { pager_open(false); } -static int link_get_type_string(int iftype, sd_device *d, char **ret) { +static int link_get_type_string(unsigned short iftype, sd_device *d, char **ret) { const char *t; char *p; @@ -106,7 +106,7 @@ static int link_get_type_string(int iftype, sd_device *d, char **ret) { typedef struct LinkInfo { const char *name; int ifindex; - unsigned iftype; + unsigned short iftype; } LinkInfo; static int link_info_compare(const void *a, const void *b) { @@ -123,7 +123,7 @@ static int decode_and_sort_links(sd_netlink_message *m, LinkInfo **ret) { for (i = m; i; i = sd_netlink_message_next(i)) { const char *name; - unsigned iftype; + unsigned short iftype; uint16_t type; int ifindex; @@ -515,7 +515,7 @@ static int link_status_one( _cleanup_strv_free_ char **carrier_bound_to = NULL; _cleanup_strv_free_ char **carrier_bound_by = NULL; struct ether_addr e; - unsigned iftype; + unsigned short iftype; int r, ifindex; bool have_mac; uint32_t mtu; diff --git a/src/systemd/sd-netlink.h b/src/systemd/sd-netlink.h index 71bcd24014a..af7a797567a 100644 --- a/src/systemd/sd-netlink.h +++ b/src/systemd/sd-netlink.h @@ -131,7 +131,7 @@ int sd_rtnl_message_link_set_type(sd_netlink_message *m, unsigned type); int sd_rtnl_message_link_set_family(sd_netlink_message *m, unsigned family); int sd_rtnl_message_link_get_ifindex(sd_netlink_message *m, int *ifindex); int sd_rtnl_message_link_get_flags(sd_netlink_message *m, unsigned *flags); -int sd_rtnl_message_link_get_type(sd_netlink_message *m, unsigned *type); +int sd_rtnl_message_link_get_type(sd_netlink_message *m, unsigned short *type); int sd_rtnl_message_route_set_dst_prefixlen(sd_netlink_message *m, unsigned char prefixlen); int sd_rtnl_message_route_set_src_prefixlen(sd_netlink_message *m, unsigned char prefixlen);