chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove unused includes
[elogind.git]
/
src
/
libsystemd
/
sd-rtnl
/
rtnl-util.c
diff --git
a/src/libsystemd/sd-rtnl/rtnl-util.c
b/src/libsystemd/sd-rtnl/rtnl-util.c
index bd97ba9ae7f0069f55e96d1d1c6651d2c488e2cf..9ddf074c24a6bb5d0e4a27330442fe27d36adb5a 100644
(file)
--- a/
src/libsystemd/sd-rtnl/rtnl-util.c
+++ b/
src/libsystemd/sd-rtnl/rtnl-util.c
@@
-19,7
+19,6
@@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <netinet/ether.h>
#include "sd-rtnl.h"
#include "sd-rtnl.h"
@@
-107,12
+106,10
@@
int rtnl_message_new_synthetic_error(int error, uint32_t serial, sd_rtnl_message
assert(error <= 0);
assert(error <= 0);
- r = message_new(NULL, ret, NLMSG_
SPACE(sizeof(struct nlmsgerr))
);
+ r = message_new(NULL, ret, NLMSG_
ERROR
);
if (r < 0)
return r;
if (r < 0)
return r;
- (*ret)->hdr->nlmsg_len = NLMSG_LENGTH(sizeof(struct nlmsgerr));
- (*ret)->hdr->nlmsg_type = NLMSG_ERROR;
(*ret)->hdr->nlmsg_seq = serial;
err = NLMSG_DATA((*ret)->hdr);
(*ret)->hdr->nlmsg_seq = serial;
err = NLMSG_DATA((*ret)->hdr);
@@
-122,6
+119,17
@@
int rtnl_message_new_synthetic_error(int error, uint32_t serial, sd_rtnl_message
return 0;
}
return 0;
}
+bool rtnl_message_type_is_neigh(uint16_t type) {
+ switch (type) {
+ case RTM_NEWNEIGH:
+ case RTM_GETNEIGH:
+ case RTM_DELNEIGH:
+ return true;
+ default:
+ return false;
+ }
+}
+
bool rtnl_message_type_is_route(uint16_t type) {
switch (type) {
case RTM_NEWROUTE:
bool rtnl_message_type_is_route(uint16_t type) {
switch (type) {
case RTM_NEWROUTE:
@@
-157,11
+165,9
@@
bool rtnl_message_type_is_addr(uint16_t type) {
}
int rtnl_log_parse_error(int r) {
}
int rtnl_log_parse_error(int r) {
- log_error_errno(r, "Failed to parse netlink message: %m");
- return r;
+ return log_error_errno(r, "Failed to parse netlink message: %m");
}
int rtnl_log_create_error(int r) {
}
int rtnl_log_create_error(int r) {
- log_error_errno(r, "Failed to create netlink message: %m");
- return r;
+ return log_error_errno(r, "Failed to create netlink message: %m");
}
}