summaryrefslogtreecommitdiff
path: root/lib/net_utils.c
blob: 148fc6e99ef63b351977bda6a3b4835e9d24083f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <linux/string.h>
#include <linux/if_ether.h>
#include <linux/ctype.h>
#include <linux/kernel.h>

bool mac_pton(const char *s, u8 *mac)
{
	int i;

	/* XX:XX:XX:XX:XX:XX */
	if (strlen(s) < 3 * ETH_ALEN - 1)
		return false;

	/* Don't dirty result unless string is valid MAC. */
	for (i = 0; i < ETH_ALEN; i++) {
		if (!isxdigit(s[i * 3]) || !isxdigit(s[i * 3 + 1]))
			return false;
		if (i != ETH_ALEN - 1 && s[i * 3 + 2] != ':')
			return false;
	}
	for (i = 0; i < ETH_ALEN; i++) {
		mac[i] = (hex_to_bin(s[i * 3]) << 4) | hex_to_bin(s[i * 3 + 1]);
	}
	return true;
}
EXPORT_SYMBOL(mac_pton);
value='feature/onemsi'>feature/onemsi Unnamed repository; edit this file to name it for gitweb.root
summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)AuthorFilesLines
2022-02-11update translations for 7.3.1 rc1Christian Lohmaier57-1014/+1021
and force-fix errors using pocheck Change-Id: I908b3cd7aa687fee135329d0c6728ebf0cf21553
2022-02-10update translations for 7.3.1 rc1Christian Lohmaier432-10266/+10150
and force-fix errors using pocheck Change-Id: I4aaa09256fc6fc2a2b70fb47f013613770e009e3
2022-01-26update translations for 7.3.0 rc3co-22.05-branch-pointChristian Lohmaier505-12876/+12814
and force-fix errors using pocheck Change-Id: Iedaea86e48ece63ca63d38dceac9b0d15091f38d (cherry picked from commit 59aa6716126252d64cbd897153f231389c05ac2d)
2022-01-20Updated Slovenian translationMartin Srebotnjak44-344/+344
Change-Id: I711fd5967b87131791f356f1e66df5f75967e496
2022-01-12update translations for 7.3.0 rc2Christian Lohmaier83-1455/+1480
and force-fix errors using pocheck Change-Id: I372f976206656723929dfd06c958afd839805a2c (cherry picked from commit 87e0eb58bfcb1cdfe04f26833376827a09c1e241)
2022-01-12Updated Slovenian translationMartin Srebotnjak18-837/+801
Change-Id: I61295497128d389d493a16057f06c1e6d8e5877e
2022-01-10update translations for 7.3.0 rc2/masterChristian Lohmaier1041-31885/+30026
and force-fix errors using pocheck Change-Id: I7ba555073adb5a8ddfcb37be8dd61c7df6ad5b40 (cherry picked from commit f6628660c35c8b21a632418e1363784b906f6ff9)
2021-12-21update translations for 7.3.0 rc1Christian Lohmaier2024-164674/+208201
and force-fix errors using pocheck Change-Id: Iaf5f970103a9ace669ee6019b2362031e34cbdf0 (cherry picked from commit f506a2490665212eeefb5934d6d4346a8a8c1856)
2021-12-19Updated Slovenian translationMartin Srebotnjak14-581/+1104
Change-Id: I23996342445afc17f98285470e1919d7775d84b5
2021-12-07Updated Slovenian translationMartin Srebotnjak18-1725/+1905
Change-Id: I6ce516b0e5d5f8e40f64232faf94be494a19e256
2021-11-25update translations for 7.3.0 beta1libreoffice-7-3-branch-pointChristian Lohmaier600-193107/+197325
and force-fix errors using pocheck Change-Id: Ibe869de5bcee1affe91172648c8a21ad9943f54a
2021-11-25Updated Slovenian translationMartin Srebotnjak22-1694/+2244
Change-Id: I403c800898f348b46aaf5f17ca96c2341409b7ba
2021-11-24update translations for master/7.3.0 beta1Christian Lohmaier2094-194498/+219039
and force-fix errors using pocheck Change-Id: I38a315bbb47e60f4dc2a2268d3ec993d27cd8c46
2021-11-17Updated Slovenian translationMartin Srebotnjak34-4233/+6825
Change-Id: I845c6b76ed9acf375b573b92e56c7960210579b6
2021-11-16update translations for masterChristian Lohmaier2911-433817/+529016
and force-fix errors using pocheck Change-Id: I93c02cdd542eb2c42765f65e9e78f2dc8f339005
2021-10-29update translations for 7.3.0 alpha1Christian Lohmaier495-25522/+125962
and force-fix errors using pocheck Change-Id: I9968e128a11cee0afa01bb87dc619ee180d2209f
2021-10-26Update Slovenian translation (xml tag fixes)Martin Srebotnjak6-24/+24
Change-Id: I351bd95533d1b9e2e4b369c3edb1aa34140997c8
2021-10-25update translations for masterChristian Lohmaier3299-327170/+451405
and force-fix errors using pocheck Change-Id: Ic6888555f22c4e961c0734fa685969b43f89c02e
2021-10-24Update Slovenian translationMartin Srebotnjak35-1930/+2043
Change-Id: Ic92f48c0e8b021b0e7c1a8fb01b553bb739df2f0
2021-10-21Update Slovenian translationMartin Srebotnjak