File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -1543,21 +1543,14 @@ static void vector_timer_expire(struct timer_list *t)
1543
1543
static void vector_setup_etheraddr (struct net_device * dev , char * str )
1544
1544
{
1545
1545
u8 addr [ETH_ALEN ];
1546
- char * end ;
1547
- int i ;
1548
1546
1549
1547
if (str == NULL )
1550
1548
goto random ;
1551
1549
1552
- for (i = 0 ; i < 6 ; i ++ ) {
1553
- addr [i ] = simple_strtoul (str , & end , 16 );
1554
- if ((end == str ) ||
1555
- ((* end != ':' ) && (* end != ',' ) && (* end != '\0' ))) {
1556
- netdev_err (dev ,
1557
- "Failed to parse '%s' as an ethernet address\n" , str );
1558
- goto random ;
1559
- }
1560
- str = end + 1 ;
1550
+ if (!mac_pton (str , addr )) {
1551
+ netdev_err (dev ,
1552
+ "Failed to parse '%s' as an ethernet address\n" , str );
1553
+ goto random ;
1561
1554
}
1562
1555
if (is_multicast_ether_addr (addr )) {
1563
1556
netdev_err (dev ,
You can’t perform that action at this time.
0 commit comments