Hi,

this function seem to be overly complicated. do you really need this ?

        John

On 07/07/2015 14:58, Günther Kelleter wrote:
> +static void inc_mac_addr(u8 *base_mac, u8 *dst_mac, u8 inc)
> +{
> +     u32  tmp = 0;
> +     char index = 6;
> +
> +     tmp = base_mac[5] + inc;
> +     while ((tmp > 255) && (index > 0)) {
> +             dst_mac[index-1] = tmp - 256;
> +             index--;
> +             tmp = base_mac[index-1] + 1;
> +     }
> +
> +     dst_mac[index-1] = tmp;
> +     index--;
> +
> +     while (index > 0) {
> +             dst_mac[index-1] = base_mac[index-1];
> +             index--;
> +     }
> +}
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to