---
name: "__dev_get_by_flags"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/__dev_get_by_flags"
---

# \_\_dev\_get\_by\_flags(9)

find any device with given flags

## NAME

\_\_dev\_get\_by\_flags - find any device with given flags

## SYNOPSIS

**struct net\_device \* \_\_dev\_get\_by\_flags(struct net \*** *net***, unsigned short** *if\_flags***, unsigned short** *mask***);**

## ARGUMENTS

*net*

the applicable net namespace

*if\_flags*

IFF\_\* values

*mask*

bitmask of bits in if\_flags to check

## DESCRIPTION

Search for any interface with the given flags. Returns NULL if a device is not found or a pointer to the device. Must be called inside **rtnl\_lock**, and result refcount is unchanged.

## COPYRIGHT
