]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Use NLMSG_TAIL
author5!tgraf <5!tgraf>
Tue, 18 Jan 2005 01:24:18 +0000 (01:24 +0000)
committer5!tgraf <5!tgraf>
Tue, 18 Jan 2005 01:24:18 +0000 (01:24 +0000)
(Logical change 1.127)

tc/f_fw.c
tc/q_cbq.c

index 64084bbfeeec961a566a1c0171330dbd053e99e2..b8134be4f170aeeaff245bb991d1a441fd904422 100644 (file)
--- a/tc/f_fw.c
+++ b/tc/f_fw.c
@@ -50,7 +50,7 @@ static int fw_parse_opt(struct filter_util *qu, char *handle, int argc, char **a
        if (argc == 0)
                return 0;
 
-       tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
+       tail = NLMSG_TAIL(n);
        addattr_l(n, 4096, TCA_OPTIONS, NULL, 0);
 
        while (argc > 0) {
@@ -98,7 +98,7 @@ static int fw_parse_opt(struct filter_util *qu, char *handle, int argc, char **a
                }
                argc--; argv++;
        }
-       tail->rta_len = (((void*)n)+n->nlmsg_len) - (void*)tail;
+       tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
        return 0;
 }
 
index 82a69ee26cad5c289616d7dbeca58fadaeff8232..3a10175d615febc9a365b8ecb11a0b274d3a8da8 100644 (file)
@@ -151,7 +151,7 @@ static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
        lss.change = TCF_CBQ_LSS_MAXIDLE|TCF_CBQ_LSS_EWMA|TCF_CBQ_LSS_AVPKT;
        lss.avpkt = avpkt;
 
-       tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
+       tail = NLMSG_TAIL(n);
        addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
        addattr_l(n, 1024, TCA_CBQ_RATE, &r, sizeof(r));
        addattr_l(n, 1024, TCA_CBQ_LSSOPT, &lss, sizeof(lss));
@@ -162,7 +162,7 @@ static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
                        printf("%u ", rtab[i]);
                printf("\n");
        }
-       tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
+       tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
        return 0;
 }
 
@@ -385,7 +385,7 @@ static int cbq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
                lss.change |= TCF_CBQ_LSS_EWMA;
        }
 
-       tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
+       tail = NLMSG_TAIL(n);
        addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
        if (lss.change) {
                lss.change |= TCF_CBQ_LSS_FLAGS;
@@ -405,7 +405,7 @@ static int cbq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
                        printf("\n");
                }
        }
-       tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
+       tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
        return 0;
 }